1 Préparation des données

# Chargement des données 
# Les .csv sont importés et stockés
Donnees_pres <- read.csv("Data/Donnees_pres_agg.csv", header = T, sep = ";", dec = ",", row.names = 2)
Donnees_pres <- as.data.frame(Donnees_pres)
FinJuil_AllPl <- read.csv("Data/FinjuilletAllplants.csv", header = T, sep = ";", dec = ",")
Interactions <- read.csv2("Data/Interactions.csv")
Site_gestion <- read.csv2("Data/Site_Gestion.csv")
Classes <- read.csv2("Data/Classes_poll.csv")
expe_Tonte <- read.csv("Data/Expe_tonte.csv", header = T, sep = ";", dec = ",")

Renommer les colonnes et mise en facteurs des variables

## Données prés
#Site_gestion_date = as.factor(Site_gestion_date),
Donnees_pres <-  Donnees_pres %>% 
  mutate(Site = as.factor(Site),
         Gestion_2 = as.factor(Gestion_2),
         Parcelle = as.factor(Parcelle),
         Gestion_3 = as.factor(Gestion_3),
         Gestion_4 = as.factor(Gestion_4),
         Mixte_isole = as.factor(Mixte_isole),
         Quartier = as.factor(Quartier),
         Jours = as.factor(Jours),
         Gestion_moment_4 = as.factor(Gestion_moment_4),
         Gestion_moment_5 = as.factor(Gestion_moment_5),
         Activite = as.factor(Activite),
         Periode = as.factor(Periode),
         Meteo = as.factor(Meteo))
#colnames(Donnees_pres)

Donnees_pres$Date <- dmy(Donnees_pres$Date)
# Donnees_pres$Heure_debut <- hms(Donnees_pres$Heure_debut)
# Donnees_pres$Heure_fin <- hms(Donnees_pres$Heure_fin)

levels(Donnees_pres$Periode) <- c("Juin", "Mi-juillet", "Fin juillet")
levels(Donnees_pres$Meteo) <- c("Alternances", "Nuageux", "Soleil")
levels(Donnees_pres$Mixte_isole) <- c("Isolé fauche", "Isolé tonte", "Mixte")
levels(Donnees_pres$Gestion_moment_4) <- c("Fauche", "Semé", "Tonte récente", "Tonte tardive")
levels(Donnees_pres$Gestion_moment_5) <- c("Fleuri", "Graminées", "Semé", "Tonte récente", "Tonte tardive")



## Inventaire
#Site_gestion_date,
Inventaire <- Donnees_pres %>% 
  select(Site,
         Nombre_quadrats,
         Gestion_2, Parcelle, Gestion_4,
         Mixte_isole,
         Area_gis_m_sq,
         #Green100, Building100, Impervious100,Natural100
         Quartier,
         Jours,
         Gestion_moment_4, Gestion_moment_5,
         Activite,
         Periode,
         Date, 
         Heure_debut, Heure_fin,
         Temperature, Meteo, 
         Achillea_millefolium:Vicia_tetrasperma_subsp._tetrasperma,
         Aglais_io:Volucella_zonaria)

Inventaire$Gestion_4 <- fct_relevel(Inventaire$Gestion_4, c("Graminees", "Fleuri", "Seme", "Tonte"))
Inventaire$Gestion_moment_5 <- fct_relevel(Inventaire$Gestion_moment_5, c("Graminées", "Fleuri", "Semé", "Tonte récente", "Tonte tardive"))
Inventaire$Mixte_isole <- fct_relevel(Inventaire$Mixte_isole, c("Isolé fauche", "Mixte", "Isolé tonte"))
Inventaire$Activite <- fct_relevel(Inventaire$Activite, c("Nulle", "Moyenne", "Forte"))
Inventaire$Meteo <- fct_relevel(Inventaire$Meteo, c("Nuageux", "Alternances", "Soleil"))


## Fin juillet all plants
FinJuil_AllPl <-  FinJuil_AllPl %>% 
  mutate(Site = as.factor(Site),
         Gestion_2 = as.factor(Gestion_2), 
         Parcelle = as.factor(Parcelle),
         Gestion_4 = as.factor(Gestion_4),
         Mixte_isole = as.factor(Mixte_isole),
         Quartier = as.factor(Quartier),
         Jours = as.factor(Jours),
         Gestion_moment_4 = as.factor(Gestion_moment_4),
         Gestion_moment_5 = as.factor(Gestion_moment_5),
         Activite = as.factor(Activite),
         Periode = as.factor(Periode),
         Meteo = as.factor(Meteo))

FinJuil_AllPl$Date <- dmy(FinJuil_AllPl$Date)
FinJuil_AllPl$Heure_debut <- hms(FinJuil_AllPl$Heure_debut)
FinJuil_AllPl$Heure_fin <- hms(FinJuil_AllPl$Heure_fin)

levels(FinJuil_AllPl$Periode) <- c("Fin juillet")
levels(FinJuil_AllPl$Meteo) <- c("Alternances", "Nuageux", "Soleil")
levels(FinJuil_AllPl$Mixte_isole) <- c("Isolé fauche", "Isolé tonte", "Mixte")
levels(FinJuil_AllPl$Gestion_moment_4) <- c("Fauche", "Semé", "Tonte récente", "Tonte tardive")
levels(FinJuil_AllPl$Gestion_moment_5) <- c("Fleuri", "Graminées", "Semé", "Tonte récente", "Tonte tardive")

AllFinJuillet <- FinJuil_AllPl %>% 
  select(Site,
         nombre_quadrats,
         Gestion_2, Parcelle, Gestion_4,
         Mixte_isole,
         Area,
         #Green100, Building100, Impervious100,Natural100
         Quartier,
         Jours,
         Gestion_moment_4, Gestion_moment_5,
         Activite,
         Periode,
         Date, 
         Heure_debut, Heure_fin,
         Temperature, Meteo, 
         Achillea_millefolium:Vicia_tetrasperma_subsp._tetrasperma,
         Aglais_io:Volucella_zonaria)

AllFinJuillet$Gestion_4 <- fct_relevel(AllFinJuillet$Gestion_4, c("Graminees", "Fleuri", "Seme", "Tonte"))
AllFinJuillet$Gestion_moment_5 <- fct_relevel(AllFinJuillet$Gestion_moment_5, c("Graminées", "Fleuri", "Semé", "Tonte récente", "Tonte tardive"))


## Interactions
Interactions <-  Interactions %>% 
  mutate(Site_gestion_date_Quadrat = as.factor(Site_gestion_date_Quadrat),
         Sp_Plantes = as.factor(Sp_Plantes),
         Sp_Pollinisateurs = as.factor(Sp_Pollinisateurs))



## Site & Classes
colnames(Site_gestion)[1:2] <- c("Site_gestion_date_Quadrat", "Site_gestion_date")
Site_gestion <-  Site_gestion %>% 
  mutate(Site_gestion_date_Quadrat = as.factor(Site_gestion_date_Quadrat),
         Site_gestion_date = as.factor(Site_gestion_date))

colnames(Classes)[1] <- c("Sp_Pollinisateurs")
Classes <-  Classes %>% 
  mutate(Sp_Pollinisateurs = as.factor(Sp_Pollinisateurs) ,
         Classe_Poll = as.factor(Classe_Poll))

2 Illustration et survol des données

2.1 Inventaires plantes et pollinisateurs

Définir une colonne Diversité spécifique (nombre d’espèces, richesse spécifique S) et Abondance des plantes et des pollinisateurs

Inventaire$S_Plant <- specnumber(Inventaire[19:67])
Inventaire$Ab_Plant <- rowSums(Inventaire[19:67])
Inventaire$S_Poll <- specnumber(Inventaire[68:166])
Inventaire$Ab_Poll <- rowSums(Inventaire[68:166])

Jeu de données simplifié et corrélations

Inv <- Inventaire[,c(1:18,167:170)]

corrplot(cor(Inv[,c(7,17,19:22)]), order = "hclust", type = "upper", tl.col = "black")

2.1.1 Statistiques descriptives

2.1.1.1 Graphiques

2.1.1.1.1 Types de gestion
Inv %>% ggplot(aes (x = Gestion_2, y = S_Plant, color = Gestion_2)) + 
  geom_boxplot(alpha = 0.70) + 
  scale_color_manual(values = c("Fauche" = "#aa1e0f",
                                "Tonte" = "#12661f")) +
  labs(#title = "Richesse spécifique en plantes en fonction des types de gestion", 
    x = "", y = "Richesse spécifique en plantes") +
  theme(legend.position = "none") +

Inv %>% ggplot(aes (x = Gestion_2, y = Ab_Plant, color = Gestion_2)) + 
  geom_boxplot(alpha = 0.70) + 
  scale_color_manual(values = c("Fauche" = "#aa1e0f",
                                "Tonte" = "#12661f")) +
  labs(#title = "Abondance en plantes en fonction des types de gestion", 
    x = "", y = "Abondance en plantes") +
  theme(legend.position = "none") +

Inv %>% ggplot(aes (x = Gestion_2, y = S_Poll, color = Gestion_2)) + 
  geom_boxplot(alpha = 0.70) + 
  scale_color_manual(values = c("Fauche" = "#aa1e0f",
                                "Tonte" = "#12661f")) +
  labs(#title = "Richesse spécifique en pollinisateurs en fonction des types de gestion", 
    x = "Type de gestion", y = "Richesse spécifique en pollinisateurs") +
  theme(legend.position = "none") +
  
Inv %>% ggplot(aes (x = Gestion_2, y = Ab_Poll, color = Gestion_2)) + 
  geom_boxplot(alpha = 0.70) + 
  scale_color_manual(values = c("Fauche" = "#aa1e0f",
                                "Tonte" = "#12661f")) +
  labs(#title = "Abondance en pollinisateurs en fonction des types de gestion", 
    x = "Type de gestion", y = "Abondance en pollinisateurs") +
  theme(legend.position = "none")

Inv %>% ggplot(aes (x = Gestion_4, y = S_Plant)) + 
  geom_boxplot(alpha = 0.70) + 
  labs(#title = "Richesse spécifique en plantes en fonction des types de gestion", 
    x = "", y = "Richesse spécifique en plantes") +

Inv %>% ggplot(aes (x = Gestion_4, y = Ab_Plant)) + 
  geom_boxplot(alpha = 0.70) + 
  labs(#title = "Abondance de plantes en fonction des types de gestion", 
    x = "", y = "Abondance en plantes") +
  
Inv %>% ggplot(aes (x = Gestion_4, y = S_Poll)) + 
  geom_boxplot(alpha = 0.70) + 
  labs(#title = "Richesse spécifique en pollinisateurs en fonction des types de gestion", 
    x = "Type de gestion", y = "Richesse spécifique en pollinisateurs") +
  
Inv %>% ggplot(aes (x = Gestion_4, y = Ab_Poll)) + 
  geom_boxplot(alpha = 0.70) + 
  labs(#title = "Abondance de pollinisateurs en fonction des types de gestion", 
    x = "Type de gestion", y = "Abondance en pollinisateurs")

Inv %>% ggplot(aes (x = Gestion_moment_4, y = S_Plant)) + 
  geom_boxplot(alpha = 0.70) + 
  labs(#title = "Richesse spécifique en plantes en fonction des types de gestion", 
    x = "", y = "Richesse spécifique en plantes") +
    theme(legend.position="none") +
  
Inv %>% ggplot(aes (x = Gestion_moment_4, y = Ab_Plant)) + 
  geom_boxplot(alpha = 0.70) + 
  labs(#title = "Abondance de plantes en fonction des types de gestion", 
    x = "", y = "Abondance en plantes") +
    theme(legend.position="none") +
  
Inv %>% ggplot(aes (x = Gestion_moment_4, y = S_Poll)) + 
  geom_boxplot(alpha = 0.70) + 
  labs(#title = "Richesse spécifique en pollinisateurs en fonction des types de gestion", 
    x = "Type de gestion", y = "Richesse spécifique en pollinisateurs", color = "Type de gestion") +
    theme(legend.position="bottom") +
  
Inv %>% ggplot(aes (x = Gestion_moment_4, y = Ab_Poll)) + 
  geom_boxplot(alpha = 0.70) + 
  labs(#title = "Abondance de pollinisateurs en fonction des types de gestion", 
    x = "Type de gestion", y = "Abondance en pollinisateurs", color = "Type de gestion") + 
    theme(legend.position="none")

Inv %>% ggplot(aes (x = Gestion_moment_5, y = S_Plant)) + 
  geom_boxplot(aes (color = Gestion_moment_5), alpha = 0.70) + 
    scale_color_manual(values = c("Graminées" = "#fbcb09",
                                  "Fleuri" = "#ff7207",
                                  "Semé" = "#de1e21",
                                  "Tonte récente" = "#6abe1d",#6dcf20
                                  "Tonte tardive" = "#2b790c")) + #12661f
  labs(#title = "Richesse spécifique en plantes en fonction des types de gestion", 
    x = "", y = "Richesse spécifique en plantes") +
    theme(legend.position = "none") +
  
Inv %>% ggplot(aes (x = Gestion_moment_5, y = Ab_Plant)) + 
  geom_boxplot(aes (color = Gestion_moment_5), alpha = 0.70) + 
      scale_color_manual(values = c("Graminées" = "#fbcb09",
                                  "Fleuri" = "#ff7207",
                                  "Semé" = "#de1e21",
                                  "Tonte récente" = "#6abe1d",
                                  "Tonte tardive" = "#2b790c")) + 
  labs(#title = "Abondance de plantes en fonction des types de gestion", 
    x = "", y = "Abondance en plantes") +
    theme(legend.position = "none") +
  
Inv %>% ggplot(aes (x = Gestion_moment_5, y = S_Poll, color = Gestion_moment_5)) + 
  geom_boxplot(alpha = 0.70) + 
        scale_color_manual(values = c("Graminées" = "#fbcb09",
                                  "Fleuri" = "#ff7207",
                                  "Semé" = "#de1e21",
                                  "Tonte récente" = "#6abe1d",
                                  "Tonte tardive" = "#2b790c")) + 
  labs(#title = "Richesse spécifique en pollinisateurs en fonction des types de gestion", 
    x = "Type de gestion", y = "Richesse spécifique en pollinisateurs") +
    theme(legend.position = "none") +
  
Inv %>% ggplot(aes (x = Gestion_moment_5, y = Ab_Poll, color = Gestion_moment_5)) + 
  geom_boxplot(alpha = 0.70) + 
        scale_color_manual(values = c("Graminées" = "#fbcb09",
                                  "Fleuri" = "#ff7207",
                                  "Semé" = "#de1e21",
                                  "Tonte récente" = "#6abe1d",
                                  "Tonte tardive" = "#2b790c")) + 
  labs(#title = "Abondance de pollinisateurs en fonction des types de gestion", 
    x = "Type de gestion", y = "Abondance en pollinisateurs") +
    theme(legend.position = "none")

2.1.1.1.2 Selon la période
Inv %>% ggplot(aes (x = Periode, y = S_Plant)) + 
  geom_boxplot(aes (color = Periode), alpha = 0.70) +
   scale_color_manual(values = c(Juin = "#74a9cf",
                                 `Mi-juillet` = "#2b8cbe",
                                 `Fin juillet` = "#045a8d")) +
  labs(#title = "Richesse spécifique en plantes en fonction de la période", 
    x = "", y = "Richesse spécifiqu en plantes") +
  theme(legend.position = "none") +
  
Inv %>% ggplot(aes (x = Periode, y = Ab_Plant)) + 
  geom_boxplot(aes (color = Periode), alpha = 0.70) + 
     scale_color_manual(values = c(Juin = "#74a9cf",
                                 `Mi-juillet` = "#2b8cbe",
                                 `Fin juillet` = "#045a8d")) +
  labs(#title = "Abondance de plantes en fonction de la période",
    x = "", y = "Abondance en plantes") +
  theme(legend.position = "none") +
  
Inv %>% ggplot(aes (x = Periode, y = S_Poll)) + 
  geom_boxplot(aes (color = Periode), alpha = 0.70) + 
     scale_color_manual(values = c(Juin = "#74a9cf",
                                 `Mi-juillet` = "#2b8cbe",
                                 `Fin juillet` = "#045a8d")) +
  labs(#title = "Richesse spécifique en pollinisateurs en fonction de la période",
    x = "Période", y = "Richesse spécifique en pollinisateurs") +
  theme(legend.position = "none") +
  
Inv %>% ggplot(aes (x = Periode, y = Ab_Poll)) +
  geom_boxplot(aes (color = Periode), alpha = 0.70) + 
     scale_color_manual(values = c(Juin = "#74a9cf",
                                 `Mi-juillet` = "#2b8cbe",
                                 `Fin juillet` = "#045a8d")) +
  labs(#title = "Abondance de pollinisateurs en fonction de la période", 
    x = "Période", y = "Abondance en pollinisateurs") +
  theme(legend.position = "none") 

Inv %>% ggplot(aes (x = Gestion_moment_5, y = S_Plant)) + 
  geom_boxplot(aes (color = Periode), alpha = 0.70) + 
       scale_color_manual(values = c(Juin = "#74a9cf",
                                 `Mi-juillet` = "#2b8cbe",
                                 `Fin juillet` = "#045a8d")) +
  labs(#title = "Richesse spécifique en plantes en fonction des types de gestion", 
    x = "", y = "Richesse spécifique en plantes") +    
  theme(legend.position="none") +
  
Inv %>% ggplot(aes (x = Gestion_moment_5, y = Ab_Plant, color = Periode)) + 
  geom_boxplot(alpha = 0.70) + 
       scale_color_manual(values = c(Juin = "#74a9cf",
                                 `Mi-juillet` = "#2b8cbe",
                                 `Fin juillet` = "#045a8d")) +
  labs(#title = "Abondance de plantes en fonction des types de gestion", 
    x = "", y = "Abondance en plantes") +
  theme(legend.position="none") +
  
Inv %>% ggplot(aes (x = Gestion_moment_5, y = S_Poll, color = Periode)) + 
  geom_boxplot(alpha = 0.70) + 
       scale_color_manual(values = c(Juin = "#74a9cf",
                                 `Mi-juillet` = "#2b8cbe",
                                 `Fin juillet` = "#045a8d")) +
  labs(#title = "Richesse spécifique en pollinisateurs en fonction des types de gestion", 
    x = "Type de gestion", y = "Richesse spécifique en pollinisateurs") +
    theme(legend.position="none") +
  
Inv %>% ggplot(aes (x = Gestion_moment_5, y = Ab_Poll, color = Periode)) +
  geom_boxplot(alpha = 0.70) + 
       scale_color_manual(values = c(Juin = "#74a9cf",
                                 `Mi-juillet` = "#2b8cbe",
                                 `Fin juillet` = "#045a8d")) +
  labs(#title = "Abondance de pollinisateurs en fonction des types de gestion", 
    x = "Type de gestion", y = "Abondance en pollinisateurs", color = "Période") +
    theme(legend.position="bottom") 

Inv %>% ggplot(aes (x = Periode, y = S_Plant, color = Gestion_moment_5)) + 
  geom_boxplot(alpha = 0.70) + 
   scale_color_manual(values = c("Graminées" = "#fbcb09",
                                  "Fleuri" = "#ff7207",
                                  "Semé" = "#de1e21",
                                  "Tonte récente" = "#6abe1d",
                                  "Tonte tardive" = "#2b790c")) +
  labs(#title = "Richesse spécifique en plantes en fonction des types de gestion", 
    x = "", y = "Richesse spécifique en plantes") +
    theme(legend.position="none") +
  
Inv %>% ggplot(aes (x = Periode, y = Ab_Plant, color = Gestion_moment_5)) + 
  geom_boxplot(alpha = 0.70) + 
   scale_color_manual(values = c("Graminées" = "#fbcb09",
                                  "Fleuri" = "#ff7207",
                                  "Semé" = "#de1e21",
                                  "Tonte récente" = "#6abe1d",
                                  "Tonte tardive" = "#2b790c")) +
  labs(#title = "Abondance de plantes en fonction des types de gestion", 
    x = "", y = "Abondance en plantes") +
    theme(legend.position="none") +
  
Inv %>% ggplot(aes (x = Periode, y = S_Poll, color = Gestion_moment_5)) + 
  geom_boxplot(alpha = 0.70) + 
   scale_color_manual(values = c("Graminées" = "#fbcb09",
                                  "Fleuri" = "#ff7207",
                                  "Semé" = "#de1e21",
                                  "Tonte récente" = "#6abe1d",
                                  "Tonte tardive" = "#2b790c")) +
  labs(#title = "Richesse spécifique en pollinisateurs en fonction des types de gestion", 
    x = "Période", y = "Richesse spécifique en pollinisateurs") +
    theme(legend.position="none") +
  
Inv %>% ggplot(aes (x = Periode, y = Ab_Poll, color = Gestion_moment_5)) +
  geom_boxplot(alpha = 0.70) + 
   scale_color_manual(values = c("Graminées" = "#fbcb09",
                                  "Fleuri" = "#ff7207",
                                  "Semé" = "#de1e21",
                                  "Tonte récente" = "#6abe1d",
                                  "Tonte tardive" = "#2b790c")) +
  labs(#title = "Abondance de pollinisateurs en fonction des types de gestion", 
    x = "Période", y = "Abondance en pollinisateurs", color= "Type de gestion") + 
    theme(legend.position="bottom")

#esquisse::esquisser()
Inv_tib <- as_tibble(Inv)
resum_invG2 <- Inv_tib %>% 
  group_by(Periode, Gestion_2) %>% 
  summarize(mean = mean(S_Plant),
            var=var(S_Plant),
            N=n()) %>% 
  mutate(CI_S=mean+qt(0.975, N-1)*sqrt(var/N),
         CI_I=mean-qt(0.975, N-1)*sqrt(var/N))
ggplot(resum_invG2, aes(x= Periode, y=mean, colour= Gestion_2, group = Gestion_2)) + 
  geom_errorbar(aes(ymin=CI_I, ymax=CI_S),width=.15,size = 1) +
  geom_point(size= 3) +
    scale_color_manual(values = c("Fauche" = "#aa1e0f",
                                "Tonte" = "#12661f")) +
  geom_line(size = 1)+
 labs(x = "Période", 
       y = "Richesse spécifique en plantes", 
       color = "Type de gestion") 

resum_inv_SPl <- Inv_tib %>% 
  group_by(Periode, Gestion_moment_5) %>% 
  summarize(mean = mean(S_Plant),
            var=var(S_Plant),
            N=n()) %>% 
  mutate(CI_S=mean+qt(0.975, N-1)*sqrt(var/N),
         CI_I=mean-qt(0.975, N-1)*sqrt(var/N))
resum_inv_APl <- Inv_tib %>% 
  group_by(Periode, Gestion_moment_5) %>% 
  summarize(mean = mean(Ab_Plant),
            var=var(Ab_Plant),
            N=n()) %>% 
  mutate(CI_S=mean+qt(0.975, N-1)*sqrt(var/N),
         CI_I=mean-qt(0.975, N-1)*sqrt(var/N))
resum_inv_SPo <- Inv_tib %>% 
  group_by(Periode, Gestion_moment_5) %>% 
  summarize(mean = mean(S_Poll),
            var=var(S_Poll),
            N=n()) %>% 
  mutate(CI_S=mean+qt(0.975, N-1)*sqrt(var/N),
         CI_I=mean-qt(0.975, N-1)*sqrt(var/N))
resum_inv_APo <- Inv_tib %>% 
  group_by(Periode, Gestion_moment_5) %>% 
  summarize(mean = mean(Ab_Poll),
            var=var(Ab_Poll),
            N=n()) %>% 
  mutate(CI_S=mean+qt(0.975, N-1)*sqrt(var/N),
         CI_I=mean-qt(0.975, N-1)*sqrt(var/N))

ggplot(resum_inv_SPl, aes(x= Periode, y=mean, colour= Gestion_moment_5, group = Gestion_moment_5)) +
  geom_errorbar(aes(ymin=CI_I, ymax=CI_S),width=.15,size = 1) +
  geom_point(size= 3) +
          scale_color_manual(values = c("Graminées" = "#fbcb09",
                                  "Fleuri" = "#ff7207",
                                  "Semé" = "#de1e21",
                                  "Tonte récente" = "#6abe1d",
                                  "Tonte tardive" = "#2b790c")) +
  geom_line(size = 1)+
  labs(x = "Période", 
       y = "Richesse spécifique en plantes", 
       color = "Type de gestion") +
  theme(legend.position="none") +
ggplot(resum_inv_APl, aes(x= Periode, y=mean, colour= Gestion_moment_5, group = Gestion_moment_5)) +
  geom_errorbar(aes(ymin=CI_I, ymax=CI_S),width=.15,size = 1) +
  geom_point(size= 3) +
          scale_color_manual(values = c("Graminées" = "#fbcb09",
                                  "Fleuri" = "#ff7207",
                                  "Semé" = "#de1e21",
                                  "Tonte récente" = "#6abe1d",
                                  "Tonte tardive" = "#2b790c")) +
  geom_line(size = 1)+
  labs(x = "Période", 
       y = "Abondance en plantes", 
       color = "Type de gestion") +
  theme(legend.position="none") +
ggplot(resum_inv_SPo, aes(x= Periode, y=mean, colour= Gestion_moment_5, group = Gestion_moment_5)) + 
  geom_errorbar(aes(ymin=CI_I, ymax=CI_S),width=.15,size = 1) +
  geom_point(size= 3) +
          scale_color_manual(values = c("Graminées" = "#fbcb09",
                                  "Fleuri" = "#ff7207",
                                  "Semé" = "#de1e21",
                                  "Tonte récente" = "#6abe1d",
                                  "Tonte tardive" = "#2b790c")) +
  geom_line(size = 1)+
  labs(x = "Période", 
       y = "Richesse spécifique en pollinisateurs", 
       color = "Type de gestion") +
  theme(legend.position="none") +
ggplot(resum_inv_APo, aes(x= Periode, y=mean, colour= Gestion_moment_5, group = Gestion_moment_5)) + 
  geom_errorbar(aes(ymin=CI_I, ymax=CI_S),width=.15,size = 1) +
  geom_point(size= 3) +
          scale_color_manual(values = c("Graminées" = "#fbcb09",
                                  "Fleuri" = "#ff7207",
                                  "Semé" = "#de1e21",
                                  "Tonte récente" = "#6abe1d",
                                  "Tonte tardive" = "#2b790c")) +
  geom_line(size = 1)+
  labs(x = "Période", 
       y = "Abondance en pollinisateurs", 
       color = "Type de gestion") +
  theme(legend.position="bottom")

2.1.1.1.3 Influences multi-factorielles
2.1.1.1.3.1 Météo
ggplot(Inv) +
  aes(x = Meteo, y = Ab_Poll, color = Meteo) +
  geom_boxplot(alpha = 0.70) +
            scale_color_manual(values = c("Nuageux" = "#7f908c",
                                  "Alternances" = "#79ccbd",
                                  "Soleil" = "#fbcb09")) +
   labs(x = "Météo", 
       y = "Abondance en pollinisateurs") +
  theme(legend.position="none")

ggplot(Inv) +
  aes(x = Gestion_moment_5, y = Ab_Poll, color = Meteo) +
  geom_boxplot(alpha = 0.70) +
              scale_color_manual(values = c("Nuageux" = "#7f908c",
                                  "Alternances" = "#79ccbd",
                                  "Soleil" = "#fbcb09")) +
   labs(x = "Type de gestion", 
       y = "Abondance en pollinisateurs", 
       color = "Météo") +
  theme(legend.position="bottom")

2.1.1.1.3.2 Températures
ggplot(Inv) +
  aes(x = Temperature, y = Ab_Poll) +
  geom_point()+ 
  geom_smooth(se = T) + 
  labs(x = "Température", 
       y = "Abondance en pollinisateurs")

ggplot(Inv) +
  aes(x = Temperature, y = Ab_Poll, color = Gestion_moment_5) +
  geom_point()+ 
            scale_color_manual(values = c("Graminées" = "#fbcb09",
                                  "Fleuri" = "#ff7207",
                                  "Semé" = "#de1e21",
                                  "Tonte récente" = "#6abe1d",
                                  "Tonte tardive" = "#2b790c")) +
  geom_smooth(se = F) + 
  labs(x = "Température", 
       y = "Abondance en pollinisateurs", 
       color = "Type de gestion") +
  theme(legend.position="bottom")

2.1.1.1.3.3 Activité anthropiques
ggplot(Inv) +
  aes(x = Activite, y = S_Poll) +
  geom_boxplot(alpha = 0.70)+
  labs(x = "Activité", 
       y = "Richesse spécifique en pollinisateurs") +
ggplot(Inv) +
  aes(x = Activite, y = Ab_Poll) +
  geom_boxplot(alpha = 0.70)+
  labs(x = "Activité", 
       y = "Abondance en pollinisateurs")

ggplot(Inv) +
  aes(x = Activite, y = Ab_Poll, color = Gestion_moment_5) +
  geom_boxplot(alpha = 0.70)+ 
              scale_color_manual(values = c("Graminées" = "#fbcb09",
                                  "Fleuri" = "#ff7207",
                                  "Semé" = "#de1e21",
                                  "Tonte récente" = "#6abe1d",
                                  "Tonte tardive" = "#2b790c")) +
  labs(x = "Activité", 
       y = "Abondance en pollinisateurs", 
       color = "Type de gestion") +
  theme(legend.position="bottom")

ggplot(Inv) +
  aes(x = Activite, y = S_Plant) +
  geom_boxplot(alpha = 0.70)+
  labs(x = "Activité", 
       y = "Richesse spécifique en plantes")+
ggplot(Inv) +
  aes(x = Activite, y = Ab_Plant) +
  geom_boxplot(alpha = 0.70)+
  labs(x = "Activité", 
       y = "Abondance en plantes")

ggplot(Inv) +
  aes(x = Activite, y = Ab_Plant, color = Gestion_moment_5) +
  geom_boxplot(alpha = 0.70)+
                scale_color_manual(values = c("Graminées" = "#fbcb09",
                                  "Fleuri" = "#ff7207",
                                  "Semé" = "#de1e21",
                                  "Tonte récente" = "#6abe1d",
                                  "Tonte tardive" = "#2b790c")) +
  labs(x = "Activité", 
       y = "Abondance en plantes", 
       color = "Type de gestion") +
  theme(legend.position="bottom")

2.1.1.1.3.4 Heure de la journée
ggplot(Inv) +
  aes(x = Heure_debut, y = Ab_Poll, color = Gestion_2) +
  geom_point() + 
    scale_color_manual(values = c("Fauche" = "#aa1e0f",
                                "Tonte" = "#12661f")) +
  scale_x_discrete(breaks = c("09:00:00","10:00:00","11:00:00","12:00:00","13:00:00","14:00:00","15:00:00","16:00:00", "17:00:00"),
                   #limits = c("09:00:00","10:00:00","11:00:00","12:00:00","13:00:00","14:00:00","15:00:00","16:00:00", "17:00:00")
                   ) +
  labs(x = "Heure", 
       y = "Abondance en pollinisateurs") 

ggplot(Inv) +
  aes(x = Heure_debut, y = Ab_Poll, color = Gestion_moment_5) +
  geom_point()+ 
        scale_color_manual(values = c("Graminées" = "#fbcb09",
                                  "Fleuri" = "#ff7207",
                                  "Semé" = "#de1e21",
                                  "Tonte récente" = "#6abe1d",
                                  "Tonte tardive" = "#2b790c")) + 
    scale_x_discrete(breaks = c("09:00:00","10:00:00","11:00:00","12:00:00","13:00:00","14:00:00","15:00:00","16:00:00", "17:00:00"),
                   #limits = c("09:00:00","10:00:00","11:00:00","12:00:00","13:00:00","14:00:00","15:00:00","16:00:00", "17:00:00")
                   ) +
  labs(x = "Heure", 
       y = "Abondance en pollinisateurs", 
       color = "Type de gestion") +
  theme(legend.position="bottom")

ggplot(Inv) +
  aes(x = Heure_fin, y = Ab_Poll, color = Gestion_2) +
  geom_point() + 
    scale_color_manual(values = c("Fauche" = "#aa1e0f",
                                "Tonte" = "#12661f")) +
  scale_x_discrete(breaks = c("09:30:00","10:30:00","11:30:00","12:30:00","13:30:00","14:30:00","15:35:00","16:30:00", "17:30:00"),
                   #limits = c("09:30:00","10:30:00","11:30:00","12:30:00","13:30:00","14:30:00","15:30:00","16:30:00", "17:30:00")
                   ) +
  labs(x = "Heure", 
       y = "Abondance en pollinisateurs") 

ggplot(Inv) +
  aes(x = Heure_fin, y = Ab_Poll, color = Gestion_moment_5) +
  geom_point()+ 
        scale_color_manual(values = c("Graminées" = "#fbcb09",
                                  "Fleuri" = "#ff7207",
                                  "Semé" = "#de1e21",
                                  "Tonte récente" = "#6abe1d",
                                  "Tonte tardive" = "#2b790c")) + 
    scale_x_discrete(breaks = c("09:30:00","10:30:00","11:30:00","12:30:00","13:30:00","14:30:00","15:35:00","16:30:00", "17:30:00"),
                   #limits = c("09:30:00","10:30:00","11:30:00","12:30:00","13:30:00","14:30:00","15:30:00","16:30:00", "17:30:00")
                   ) +
  labs(x = "Heure", 
       y = "Abondance en pollinisateurs", 
       color = "Type de gestion") +
  theme(legend.position="bottom")

2.1.1.2 Statistiques par groupes

Création d’une fonction pour faire des statistiques descriptives par groupe

statdesbygroup=function(Y, X)
  {# 1. On récupére les niveaux de X et le nombre de niveaux
  X=as.factor(X)
  levX=levels(X)
  nlevX=length(levX)
# 2. On crée la matrice pour les statistique descriptive
  mesStats<-matrix(nrow=nlevX,ncol=7)
  colnames(mesStats)=c("N","Moyenne","Médiane","Ecart-type","Variance","Min","Max" )
  rownames(mesStats)=levels(Inv$Gestion_moment_5)
# 3. On calcule les statistiques descriptives
  for(i in 1:nlevX)
  {indlevel=which(X==levX[i])
    mesStats[i,]<-c(length(Y[indlevel]),mean(Y[indlevel]),median(Y[indlevel]),sd(Y[indlevel]),var(Y[indlevel]),min(Y[indlevel]), max(Y[indlevel]))}
# 4. On retourne les résultats 
  return(mesStats)
}


SBG_SPlant <- statdesbygroup(
  Y = c(Inv$S_Plant), 
  X = c(Inv$Gestion_moment_5))
SBG_SPlant 
##                N  Moyenne Médiane Ecart-type   Variance Min Max
## Graminées     11 2.090909       2  2.0225996  4.0909091   0   5
## Fleuri        30 5.566667       5  2.9674479  8.8057471   1  13
## Semé          18 9.055556       9  3.6213781 13.1143791   3  17
## Tonte récente 26 1.923077       2  0.9347974  0.8738462   0   4
## Tonte tardive 49 3.510204       3  1.3711681  1.8801020   1   6
# %>% 
#   kbl(caption = "Richesse spécifique de la flore") %>%
#   kable_classic(full_width = F, html_font = "Cambria") # %>% kable_styling() %>%
# save_kable(file = "Output/Tableau/table_SPlant.pdf")

SBG_AbPlant  <- statdesbygroup(
  Y = c(Inv$Ab_Plant), 
  X = c(Inv$Gestion_moment_5))
SBG_AbPlant 
##                N   Moyenne Médiane Ecart-type   Variance Min Max
## Graminées     11  18.72727    15.0   18.81006   353.8182   0  52
## Fleuri        30 101.96667    49.0  114.09297 13017.2057   3 439
## Semé          18 131.11111   110.5   81.39438  6625.0458  11 299
## Tonte récente 26  30.34615    21.5   27.44586   753.2754   0  90
## Tonte tardive 49  90.63265    65.0   84.70874  7175.5706   7 451
# %>% 
#   kbl(caption = "Abondance de la flore") %>%
#   kable_classic(full_width = F, html_font = "Cambria") # %>%  kable_styling() %>%
   # save_kable(file = "Output/Tableau/table_AbPlant.pdf")


SBG_SPoll <- statdesbygroup(
  Y = c(Inv$S_Poll), 
  X = c(Inv$Gestion_moment_5)) 
SBG_SPoll
##                N   Moyenne Médiane Ecart-type  Variance Min Max
## Graminées     11  4.545455     4.0   4.321195 18.672727   0  12
## Fleuri        30  8.733333     8.5   4.143406 17.167816   0  17
## Semé          18 12.055556    12.0   4.165294 17.349673   4  21
## Tonte récente 26  1.538462     1.0   1.272188  1.618462   0   5
## Tonte tardive 49  3.244898     3.0   1.984635  3.938776   0   9
# %>% 
#   kbl(caption = "Richesse spécifique de la faune pollinisatrice") %>%
#   kable_classic(full_width = F, html_font = "Cambria") # %>% kable_styling() %>%
#    save_kable(file = "Output/Tableau/table_SPoll.pdf")

SBG_AbPoll <- statdesbygroup(
  Y = c(Inv$Ab_Poll), 
  X = c(Inv$Gestion_moment_5))
SBG_AbPoll 
##                N   Moyenne Médiane Ecart-type   Variance Min Max
## Graminées     11  9.454545     4.0  12.532866 157.072727   0  42
## Fleuri        30 18.400000    17.5  11.278909 127.213793   0  43
## Semé          18 34.333333    35.0  14.868047 221.058824   4  61
## Tonte récente 26  2.038462     1.0   1.865063   3.478462   0   7
## Tonte tardive 49  7.469388     6.0   6.010761  36.129252   0  26
# %>% 
#   kbl(caption = "Abondance de la faune pollinisatrice") %>%
#   kable_classic(full_width = F, html_font = "Cambria") # %>% kable_styling() %>%
#    save_kable(file = "Output/Tableau/table_AbPoll.pdf")
statdesbygroup=function(Y, X)
  {# 1. On récupére les niveaux de X et le nombre de niveaux
  X=as.factor(X)
  levX=levels(X)
  nlevX=length(levX)
# 2. On crée la matrice pour les statistique descriptive
  mesStats<-matrix(nrow=nlevX,ncol=7)
  colnames(mesStats)=c("N","Moyenne","Médiane","Ecart-type","Variance","Min","Max" )
  rownames(mesStats)=levels(Inv$Periode)
# 3. On calcule les statistiques descriptives
  for(i in 1:nlevX)
  {indlevel=which(X==levX[i])
    mesStats[i,]<-c(length(Y[indlevel]),mean(Y[indlevel]),median(Y[indlevel]),sd(Y[indlevel]),var(Y[indlevel]),min(Y[indlevel]), max(Y[indlevel]))}
# 4. On retourne les résultats 
  return(mesStats)
}


SBG_SPlant_Periode <- statdesbygroup(
  Y = c(Inv$S_Plant), 
  X = c(Inv$Periode))
SBG_SPlant_Periode 
##              N  Moyenne Médiane Ecart-type  Variance Min Max
## Juin        46 4.782609       4   3.450688 11.907246   0  17
## Mi-juillet  46 4.108696       3   3.121455  9.743478   0  13
## Fin juillet 42 3.952381       3   2.819379  7.948897   0  13
# %>% 
#   kbl(caption = "Richesse spécifique de la flore") %>%
#   kable_classic(full_width = F, html_font = "Cambria")  #  %>% kable_styling() %>%
# save_kable(file = "Output/Tableau/table_SPlant_Periode.pdf")

SBG_AbPlant_Periode  <- statdesbygroup(
  Y = c(Inv$Ab_Plant), 
  X = c(Inv$Periode))
SBG_AbPlant_Periode 
##              N   Moyenne Médiane Ecart-type  Variance Min Max
## Juin        46 119.36957    86.0  111.70484 12477.971   0 451
## Mi-juillet  46  67.41304    37.5   73.57553  5413.359   0 299
## Fin juillet 42  53.88095    37.0   53.42248  2853.961   0 239
# %>% 
#   kbl(caption = "Abondance de la flore") %>%
#   kable_classic(full_width = F, html_font = "Cambria") #  %>%  kable_styling() %>%
 #    save_kable(file = "Output/Tableau/table_AbPlant_Periode.pdf")


SBG_SPoll_Periode <- statdesbygroup(
  Y = c(Inv$S_Poll), 
  X = c(Inv$Periode)) 
SBG_SPoll_Periode 
##              N  Moyenne Médiane Ecart-type Variance Min Max
## Juin        46 6.217391     5.5   4.939244 24.39614   0  21
## Mi-juillet  46 5.413043     4.0   5.144905 26.47005   0  19
## Fin juillet 42 4.595238     3.0   3.876505 15.02729   0  16
# %>% 
#   kbl(caption = "Richesse spécifique de la faune pollinisatrice") %>%
#   kable_classic(full_width = F, html_font = "Cambria")#  %>% kable_styling() %>%
 #   save_kable(file = "Output/Tableau/table_SPoll_Periode.pdf")

SBG_AbPoll_Periode <- statdesbygroup(
  Y = c(Inv$Ab_Poll), 
  X = c(Inv$Periode))
SBG_AbPoll_Periode 
##              N   Moyenne Médiane Ecart-type Variance Min Max
## Juin        46 13.391304    10.5   11.73689 137.7546   0  41
## Mi-juillet  46 14.478261     8.0   17.16552 294.6551   0  61
## Fin juillet 42  9.785714     4.0   10.66916 113.8310   0  42
# %>% 
#   kbl(caption = "Abondance de la faune pollinisatrice") %>%
#   kable_classic(full_width = F, html_font = "Cambria") # %>% kable_styling() %>%
 # save_kable(file = "Output/Tableau/table_AbPoll_Periode.pdf")

2.1.2 Courbes d’accumulation

#Préparations données
especes <- Inventaire[,c(19:166)]

Esp_Plant <- Inventaire[,c(19:67)]
Esp_Poll <- Inventaire[,c(68:166)]

Inv_red <- Inventaire[,c(3:5,10:11,13:14,167:170)]

2.1.2.1 Plantes

# accumcomp(Esp_Plant, y = Inv_red, factor = "Gestion_2", col = c("#aa1e0f","#12661f"), rainbow = F, xlim = c(1,90), plotit = TRUE, labelit = F, legend = F, xlab = "Nombre d'échantillonnages", ylab = "Nombre d'espèces")[1]
# legend("topright", legend = c("Fauche", "Tonte"), col = c("#aa1e0f", "#12661f"), lty = 1, xpd = TRUE, inset = c(0,-0.2), horiz = F)

Accum.Plantes_G2 <- accumcomp(Esp_Plant, y=Inv_red, factor='Gestion_2',
    method='exact', conditioned=FALSE, plotit=FALSE)
accum.long_Plantes_G2 <- accumcomp.long(Accum.Plantes_G2, ci=NA, label.freq=1)
plG2 <- ggplot(data=accum.long_Plantes_G2, aes(x = Sites, y = Richness, ymax = UPR, ymin = LWR)) + 
    scale_x_continuous(sec.axis = dup_axis(labels=NULL, name=NULL)) +
    scale_y_continuous(sec.axis = dup_axis(labels=NULL, name=NULL)) +
    geom_line(aes(colour=Grouping), size=1.5) +
    geom_point(data=subset(accum.long_Plantes_G2, labelit==TRUE), 
               aes(colour=Grouping, shape=Grouping), size=2.5) +
      scale_shape_manual(values = c("Fauche" = 16,
                                  "Tonte" = 5)) +
    geom_ribbon(aes(colour=Grouping, fill=after_scale(alpha(colour, alpha=0.15))), 
                show.legend=FALSE) + 
    scale_color_manual(values = c("Fauche" = "#aa1e0f",
                                "Tonte" = "#12661f")) +
    labs(x = "Nombre d'échantillonages", y = "Nombre d'espèces de plantes", colour = "Type de gestion", shape = "Type de gestion") + 
  theme(legend.position = "bottom")

# accumcomp(Esp_Plant, y = Inv_red, factor = "Gestion_moment_5", col = c("darkgreen", "green"), xlim = c(1,70), plotit = T, labelit = F, rainbow = F, legend = F, xlab = "Nombre d'échantillonages", ylab = "Nombre d'espèces")[1] 
# legend("topright", legend = c("Fleuri", "Graminées", "Semé","Tonte récente", "Tonte tardive"), col = rainbow(5), lty = 1, xpd = TRUE, inset = c(0,-0.2), horiz = F)

Accum.Plantes_G5 <- accumcomp(Esp_Plant, y=Inv_red, factor='Gestion_moment_5',
    method='exact', conditioned=FALSE, plotit=FALSE)
accum.long_Plantes_G5 <- accumcomp.long(Accum.Plantes_G5, ci=NA, label.freq=1)
accum.long_Plantes_G5$Grouping <-  fct_relevel(accum.long_Plantes_G5$Grouping,c("Graminées", "Fleuri", "Semé", "Tonte récente", "Tonte tardive"))
plG5 <- ggplot(data=accum.long_Plantes_G5, aes(x = Sites, y = Richness, ymax = UPR, ymin = LWR)) + 
    scale_x_continuous(sec.axis = dup_axis(labels=NULL, name=NULL)) +
    scale_y_continuous(sec.axis = dup_axis(labels=NULL, name=NULL)) +
    geom_line(aes(colour=Grouping), size=1.5) +
    geom_point(data=subset(accum.long_Plantes_G5, labelit==T), 
               aes(colour=Grouping, shape=Grouping), size=2.5) +
    scale_shape_manual(values = c("Graminées" = 16,
                                  "Fleuri" = 17,
                                  "Semé" = 15,
                                  "Tonte récente" = 5,
                                  "Tonte tardive" = 6)) +
    geom_ribbon(aes(colour=Grouping, fill=after_scale(alpha(colour, alpha=0.15))), 
                show.legend=FALSE) + 
      scale_color_manual(values = c("Graminées" = "#fbcb09",
                                  "Fleuri" = "#ff7207",
                                  "Semé" = "#de1e21",
                                  "Tonte récente" = "#6abe1d",
                                  "Tonte tardive" = "#2b790c")) + 
    labs(x = "Nombre d'échantillonages", y = "Nombre d'espèces de plantes", colour = "Type de gestion", shape = "Type de gestion") +
  theme(legend.position = "bottom")

plG2 + plG5

2.1.2.1.1 Périodes
# Juin
Inv_Juin <- Inv_red %>% 
  filter(Periode == "Juin")
Esp_Plant_Juin <- Esp_Plant %>% 
  rownames_to_column(var = "temp") %>% 
  filter(grepl("Juin$", temp)) %>% 
    column_to_rownames(var = "temp")

Accum.Plantes_Juin <- accumcomp(Esp_Plant_Juin, y=Inv_Juin, factor='Gestion_moment_5',
    method='exact', conditioned=FALSE, plotit=FALSE)


accum.long_Plantes_Juin <- accumcomp.long(Accum.Plantes_Juin, ci=NA, label.freq=1)
accum.long_Plantes_Juin$Grouping <-  fct_relevel(accum.long_Plantes_Juin$Grouping,c("Graminées", "Fleuri", "Semé", "Tonte récente", "Tonte tardive"))
pl_Juin <- ggplot(data=accum.long_Plantes_Juin, aes(x = Sites, y = Richness, ymax = UPR, ymin = LWR)) + 
    scale_x_continuous(sec.axis = dup_axis(labels=NULL, name=NULL)) +
    scale_y_continuous(sec.axis = dup_axis(labels=NULL, name=NULL)) +
    geom_line(aes(colour=Grouping), size=1.5) +
    geom_point(data=subset(accum.long_Plantes_Juin, labelit==T), 
               aes(colour=Grouping, shape=Grouping), size=2.5) +
    scale_shape_manual(values = c("Graminées" = 16,
                                  "Fleuri" = 17,
                                  "Semé" = 15,
                                  "Tonte récente" = 5,
                                  "Tonte tardive" = 6)) +
    geom_ribbon(aes(colour=Grouping, fill=after_scale(alpha(colour, alpha=0.15))), 
                show.legend=FALSE) + 
      scale_color_manual(values = c("Graminées" = "#fbcb09",
                                  "Fleuri" = "#ff7207",
                                  "Semé" = "#de1e21",
                                  "Tonte récente" = "#6abe1d",
                                  "Tonte tardive" = "#2b790c")) + 
    labs(x = "", y = "Nombre d'espèces de plantes", colour = "Type de gestion", shape = "Type de gestion") +
  theme(legend.position = "none")



# mi Juillet
Inv_miJuillet <- Inv_red %>% 
  filter(Periode == "Mi-juillet")
Esp_Plant_miJuillet <- Esp_Plant %>% 
  rownames_to_column(var = "temp") %>% 
  filter(grepl("miJuillet$", temp)) %>% 
    column_to_rownames(var = "temp")

Accum.Plantes_miJuillet <- accumcomp(Esp_Plant_miJuillet, y=Inv_miJuillet, factor='Gestion_moment_5',
    method='exact', conditioned=FALSE, plotit=FALSE)


accum.long_Plantes_miJuillet <- accumcomp.long(Accum.Plantes_miJuillet, ci=NA, label.freq=1)
accum.long_Plantes_miJuillet$Grouping <-  fct_relevel(accum.long_Plantes_miJuillet$Grouping,c("Graminées", "Fleuri", "Semé", "Tonte récente", "Tonte tardive"))
pl_miJuillet <- ggplot(data=accum.long_Plantes_miJuillet, aes(x = Sites, y = Richness, ymax = UPR, ymin = LWR)) + 
    scale_x_continuous(sec.axis = dup_axis(labels=NULL, name=NULL)) +
    scale_y_continuous(sec.axis = dup_axis(labels=NULL, name=NULL)) +
    geom_line(aes(colour=Grouping), size=1.5) +
    geom_point(data=subset(accum.long_Plantes_miJuillet, labelit==T), 
               aes(colour=Grouping, shape=Grouping), size=2.5) +
    scale_shape_manual(values = c("Graminées" = 16,
                                  "Fleuri" = 17,
                                  "Semé" = 15,
                                  "Tonte récente" = 5,
                                  "Tonte tardive" = 6)) +
    geom_ribbon(aes(colour=Grouping, fill=after_scale(alpha(colour, alpha=0.15))), 
                show.legend=FALSE) + 
      scale_color_manual(values = c("Graminées" = "#fbcb09",
                                  "Fleuri" = "#ff7207",
                                  "Semé" = "#de1e21",
                                  "Tonte récente" = "#6abe1d",
                                  "Tonte tardive" = "#2b790c")) + 
    labs(x = "Nombre d'échantillonages", y = "Nombre d'espèces de plantes", colour = "Type de gestion", shape = "Type de gestion") +
  theme(legend.position = "bottom",
       # axis.title.x=element_blank(),
        axis.title.y=element_blank())


# fin Juillet
Inv_finJuillet <- Inv_red %>% 
  filter(Periode == "Fin juillet")
Esp_Plant_finJuillet <- Esp_Plant %>% 
  rownames_to_column(var = "temp") %>% 
  filter(grepl("finJuillet$", temp)) %>% 
    column_to_rownames(var = "temp")

Accum.Plantes_finJuillet <- accumcomp(Esp_Plant_finJuillet, y=Inv_finJuillet, factor='Gestion_moment_5',
    method='exact', conditioned=FALSE, plotit=FALSE)


accum.long_Plantes_finJuillet <- accumcomp.long(Accum.Plantes_finJuillet, ci=NA, label.freq=1)
accum.long_Plantes_finJuillet$Grouping <-  fct_relevel(accum.long_Plantes_finJuillet$Grouping,c("Graminées", "Fleuri", "Semé", "Tonte récente", "Tonte tardive"))
pl_finJuillet <- ggplot(data=accum.long_Plantes_finJuillet, aes(x = Sites, y = Richness, ymax = UPR, ymin = LWR)) + 
    scale_x_continuous(sec.axis = dup_axis(labels=NULL, name=NULL)) +
    scale_y_continuous(sec.axis = dup_axis(labels=NULL, name=NULL)) +
    geom_line(aes(colour=Grouping), size=1.5) +
    geom_point(data=subset(accum.long_Plantes_finJuillet, labelit==T), 
               aes(colour=Grouping, shape=Grouping), size=2.5) +
    scale_shape_manual(values = c("Graminées" = 16,
                                  "Fleuri" = 17,
                                  "Semé" = 15,
                                  "Tonte récente" = 5,
                                  "Tonte tardive" = 6)) +
    geom_ribbon(aes(colour=Grouping, fill=after_scale(alpha(colour, alpha=0.15))), 
                show.legend=FALSE) + 
      scale_color_manual(values = c("Graminées" = "#fbcb09",
                                  "Fleuri" = "#ff7207",
                                  "Semé" = "#de1e21",
                                  "Tonte récente" = "#6abe1d",
                                  "Tonte tardive" = "#2b790c")) + 
    labs(x = "", y = "Nombre d'espèces de plantes", colour = "Type de gestion", shape = "Type de gestion") +
  theme(legend.position = "none",
        axis.title.y=element_blank())



ggarrange(pl_Juin, pl_miJuillet, pl_finJuillet, ncol = 3, common.legend = TRUE, legend="bottom") 

#ggarrange(pl_Juin, pl_miJuillet, pl_finJuillet, ncol = 1, common.legend = TRUE, legend="bottom")

2.1.2.2 Pollinisateurs

# accumcomp(Esp_Poll, y = Inv_red, factor = "Gestion_2", xlim = c(1,90), plotit = T, labelit = F, rainbow = T, legend = F, xlab = "Nombre d'échantillonages", ylab = "Nombre d'espèces")[1] 
# legend("topright", legend = c("Fauche", "Tonte"), col = rainbow(2), lty = 1, xpd = TRUE, inset = c(0,-0.2), horiz = F)

Accum.Poll_G2 <- accumcomp(Esp_Poll, y=Inv_red, factor='Gestion_2',
    method='exact', conditioned=FALSE, plotit=FALSE)
accum.long_Poll_G2 <- accumcomp.long(Accum.Poll_G2, ci=NA, label.freq=1)
pollG2 <- ggplot(data=accum.long_Poll_G2, aes(x = Sites, y = Richness, ymax = UPR, ymin = LWR)) + 
    scale_x_continuous(sec.axis = dup_axis(labels=NULL, name=NULL)) +
    scale_y_continuous(sec.axis = dup_axis(labels=NULL, name=NULL)) +
    geom_line(aes(colour=Grouping), size=1.5) +
    geom_point(data=subset(accum.long_Poll_G2, labelit==TRUE), 
               aes(colour=Grouping, shape=Grouping), size=2.5) +
    scale_shape_manual(values = c("Fauche" = 16,
                                  "Tonte" = 4)) +
    geom_ribbon(aes(colour=Grouping, fill=after_scale(alpha(colour, alpha=0.15))), 
                show.legend=FALSE) + 
    scale_color_manual(values = c("Fauche" = "#aa1e0f",
                                "Tonte" = "#12661f")) +
    labs(x = "Nombre d'échantillonages", y = "Nombre d'espèces de pollinisateurs", colour = "Type de gestion", shape = "Type de gestion") + 
  theme(legend.position = "bottom")

# accumcomp(Esp_Poll, y = Inv_red, factor = "Gestion_moment_5", col = c("blue"), xlim = c(1,70), xlab = "Nombre d'échantillonages", ylab = "Nombre d'espèces", plotit = T, labelit = F, legend = F, rainbow = F)[1] 
# legend("topright", legend = c("Fleuri", "Graminées", "Semé","Tonte récente", "Tonte tardive"), col = rainbow(5), lty = 1, xpd = TRUE, inset = c(0,-0.2), horiz = F)

Accum.Poll_G5 <- accumcomp(Esp_Poll, y=Inv_red, factor='Gestion_moment_5',
    method='exact', conditioned=FALSE, plotit=FALSE)
accum.long_Poll_G5 <- accumcomp.long(Accum.Poll_G5, ci=NA, label.freq=1)
accum.long_Poll_G5$Grouping <-  fct_relevel(accum.long_Poll_G5$Grouping,c("Graminées", "Fleuri", "Semé", "Tonte récente", "Tonte tardive"))

pollG5 <- ggplot(data=accum.long_Poll_G5, aes(x = Sites, y = Richness, ymax = UPR, ymin = LWR)) + 
    scale_x_continuous(sec.axis = dup_axis(labels=NULL, name=NULL)) +
    scale_y_continuous(sec.axis = dup_axis(labels=NULL, name=NULL)) +
    geom_line(aes(colour=Grouping), size=1.5) +
    geom_point(data=subset(accum.long_Poll_G5, labelit==T), 
               aes(colour=Grouping, shape=Grouping), size=2.5) +
  scale_shape_manual(values = c("Graminées" = 16,
                                  "Fleuri" = 15,
                                  "Semé" = 17,
                                  "Tonte récente" = 4,
                                  "Tonte tardive" = 8)) + 
    geom_ribbon(aes(colour=Grouping, fill=after_scale(alpha(colour, alpha=0.15))), 
                show.legend=FALSE) + 
      scale_color_manual(values = c("Graminées" = "#fbcb09",
                                  "Fleuri" = "#ff7207",
                                  "Semé" = "#de1e21",
                                  "Tonte récente" = "#6abe1d",
                                  "Tonte tardive" = "#2b790c")) + 
    labs(x = "Nombre d'échantillonages", y = "Nombre d'espèces de pollinisateurs", colour = "Type de gestion", shape = "Type de gestion") +
  theme(legend.position = "bottom")

pollG2 + pollG5

2.1.2.2.1 Périodes
# Juin
Inv_Juin <- Inv_red %>% 
  filter(Periode == "Juin")
Esp_Poll_Juin <- Esp_Poll %>% 
  rownames_to_column(var = "temp") %>% 
  filter(grepl("Juin$", temp)) %>% 
    column_to_rownames(var = "temp")

Accum.Poll_Juin <- accumcomp(Esp_Poll_Juin, y=Inv_Juin, factor='Gestion_moment_5',
    method='exact', conditioned=FALSE, plotit=FALSE)


accum.long_Poll_Juin <- accumcomp.long(Accum.Poll_Juin, ci=NA, label.freq=1)
accum.long_Poll_Juin$Grouping <-  fct_relevel(accum.long_Poll_Juin$Grouping,c("Graminées", "Fleuri", "Semé", "Tonte récente", "Tonte tardive"))
poll_Juin <- ggplot(data=accum.long_Poll_Juin, aes(x = Sites, y = Richness, ymax = UPR, ymin = LWR)) + 
    scale_x_continuous(sec.axis = dup_axis(labels=NULL, name=NULL)) +
    scale_y_continuous(sec.axis = dup_axis(labels=NULL, name=NULL)) +
    geom_line(aes(colour=Grouping), size=1.5) +
    geom_point(data=subset(accum.long_Poll_Juin, labelit==T), 
               aes(colour=Grouping, shape=Grouping), size=2.5) +
    scale_shape_manual(values = c("Graminées" = 16,
                                  "Fleuri" = 17,
                                  "Semé" = 15,
                                  "Tonte récente" = 5,
                                  "Tonte tardive" = 6)) +
    geom_ribbon(aes(colour=Grouping, fill=after_scale(alpha(colour, alpha=0.15))), 
                show.legend=FALSE) + 
      scale_color_manual(values = c("Graminées" = "#fbcb09",
                                  "Fleuri" = "#ff7207",
                                  "Semé" = "#de1e21",
                                  "Tonte récente" = "#6abe1d",
                                  "Tonte tardive" = "#2b790c")) + 
    labs(x = "", y = "Nombre de taxa de pollinisateurs", colour = "Type de gestion", shape = "Type de gestion") +
  theme(legend.position = "none")



# mi Juillet
Inv_miJuillet <- Inv_red %>% 
  filter(Periode == "Mi-juillet")
Esp_Poll_miJuillet <- Esp_Poll %>% 
  rownames_to_column(var = "temp") %>% 
  filter(grepl("miJuillet$", temp)) %>% 
    column_to_rownames(var = "temp")

Accum.Poll_miJuillet <- accumcomp(Esp_Poll_miJuillet, y=Inv_miJuillet, factor='Gestion_moment_5',
    method='exact', conditioned=FALSE, plotit=FALSE)


accum.long_Poll_miJuillet <- accumcomp.long(Accum.Poll_miJuillet, ci=NA, label.freq=1)
accum.long_Poll_miJuillet$Grouping <-  fct_relevel(accum.long_Poll_miJuillet$Grouping,c("Graminées", "Fleuri", "Semé", "Tonte récente", "Tonte tardive"))
poll_miJuillet <- ggplot(data=accum.long_Poll_miJuillet, aes(x = Sites, y = Richness, ymax = UPR, ymin = LWR)) + 
    scale_x_continuous(sec.axis = dup_axis(labels=NULL, name=NULL)) +
    scale_y_continuous(sec.axis = dup_axis(labels=NULL, name=NULL)) +
    geom_line(aes(colour=Grouping), size=1.5) +
    geom_point(data=subset(accum.long_Poll_miJuillet, labelit==T), 
               aes(colour=Grouping, shape=Grouping), size=2.5) +
    scale_shape_manual(values = c("Graminées" = 16,
                                  "Fleuri" = 17,
                                  "Semé" = 15,
                                  "Tonte récente" = 5,
                                  "Tonte tardive" = 6)) +
    geom_ribbon(aes(colour=Grouping, fill=after_scale(alpha(colour, alpha=0.15))), 
                show.legend=FALSE) + 
      scale_color_manual(values = c("Graminées" = "#fbcb09",
                                  "Fleuri" = "#ff7207",
                                  "Semé" = "#de1e21",
                                  "Tonte récente" = "#6abe1d",
                                  "Tonte tardive" = "#2b790c")) + 
    labs(x = "Nombre d'échantillonages", y = "Nombre de taxa de pollinisateurs", colour = "Type de gestion", shape = "Type de gestion") +
  theme(legend.position = "bottom",
       # axis.title.x=element_blank(),
        axis.title.y=element_blank())


# fin Juillet
Inv_finJuillet <- Inv_red %>% 
  filter(Periode == "Fin juillet")
Esp_Poll_finJuillet <- Esp_Poll %>% 
  rownames_to_column(var = "temp") %>% 
  filter(grepl("finJuillet$", temp)) %>% 
    column_to_rownames(var = "temp")

Accum.Poll_finJuillet <- accumcomp(Esp_Poll_finJuillet, y=Inv_finJuillet, factor='Gestion_moment_5',
    method='exact', conditioned=FALSE, plotit=FALSE)


accum.long_Poll_finJuillet <- accumcomp.long(Accum.Poll_finJuillet, ci=NA, label.freq=1)
accum.long_Poll_finJuillet$Grouping <-  fct_relevel(accum.long_Poll_finJuillet$Grouping,c("Graminées", "Fleuri", "Semé", "Tonte récente", "Tonte tardive"))
poll_finJuillet <- ggplot(data=accum.long_Poll_finJuillet, aes(x = Sites, y = Richness, ymax = UPR, ymin = LWR)) + 
    scale_x_continuous(sec.axis = dup_axis(labels=NULL, name=NULL)) +
    scale_y_continuous(sec.axis = dup_axis(labels=NULL, name=NULL)) +
    geom_line(aes(colour=Grouping), size=1.5) +
    geom_point(data=subset(accum.long_Poll_finJuillet, labelit==T), 
               aes(colour=Grouping, shape=Grouping), size=2.5) +
    scale_shape_manual(values = c("Graminées" = 16,
                                  "Fleuri" = 17,
                                  "Semé" = 15,
                                  "Tonte récente" = 5,
                                  "Tonte tardive" = 6)) +
    geom_ribbon(aes(colour=Grouping, fill=after_scale(alpha(colour, alpha=0.15))), 
                show.legend=FALSE) + 
      scale_color_manual(values = c("Graminées" = "#fbcb09",
                                  "Fleuri" = "#ff7207",
                                  "Semé" = "#de1e21",
                                  "Tonte récente" = "#6abe1d",
                                  "Tonte tardive" = "#2b790c")) + 
    labs(x = "", y = "Nombre de taxa de pollinisateurs", colour = "Type de gestion", shape = "Type de gestion") +
  theme(legend.position = "none",
        axis.title.y=element_blank())



ggarrange(poll_Juin, poll_miJuillet, poll_finJuillet, ncol = 3, common.legend = TRUE, legend="bottom") 

#ggarrange(poll_Juin, poll_miJuillet, poll_finJuillet, ncol = 1, common.legend = TRUE, legend="bottom")

2.1.3 Catégories de pollinisateurs

Inv_Classes_pl <- Inventaire %>% 
  rownames_to_column(var="Site_gestion_date") %>% 
  select(Site_gestion_date, Aglais_io:Volucella_zonaria) %>% 
  pivot_longer(cols = Aglais_io:Volucella_zonaria,
               names_to = "Sp_poll",
               values_to = "Donnees") %>% 
  mutate(Sp_poll = as.factor(Sp_poll))

Inv_Classes_join_pw <- left_join(Inv_Classes_pl, Classes, by = c("Sp_poll" = "Sp_Pollinisateurs")) %>% 
   pivot_wider(names_from = Classe_Poll,
              values_from = Donnees,
              values_fill = 0) %>% 
  select(-Sp_poll)
Inv_Classes <- aggregate(.~ Site_gestion_date, data=Inv_Classes_join_pw, FUN=sum)

Inv_noms <- Inventaire %>% 
  rownames_to_column(var="Site_gestion_date") %>% 
  select(Site, Site_gestion_date,
         Nombre_quadrats,
         Gestion_2, Parcelle, Gestion_4,
         Mixte_isole,
         Gestion_moment_4, Gestion_moment_5,
         Periode,
         Area_gis_m_sq,
         Quartier,
         Activite,
         Temperature, Meteo)

Inv_fulljoin <- full_join(Site_gestion, Inv_noms, by = "Site_gestion_date") %>% 
  select(-Site_gestion_date_Quadrat) %>% 
  distinct(Site_gestion_date, .keep_all = TRUE)

Inventaire_Classes <- full_join(Inv_fulljoin, Inv_Classes, by = "Site_gestion_date")

Inventaire_Classes$S_class <- specnumber(Inventaire_Classes[16:21])
Inventaire_Classes$Ab_class <- rowSums(Inventaire_Classes[16:21])

2.2 Réseaux d’interactions

2.2.1 Préparation des données et tests

Inv_noms <- Inventaire %>% 
  rownames_to_column(var="Site_gestion_date") %>% 
  select(Site, Site_gestion_date,
         Nombre_quadrats,
         Gestion_2, Parcelle, Gestion_4,
         Mixte_isole,
         Gestion_moment_4, Gestion_moment_5,
         Periode,
         Area_gis_m_sq,
         Quartier,
         Activite,
         Temperature, Meteo)

Inv_fulljoin <- full_join(Site_gestion, Inv_noms, by = "Site_gestion_date")

Interactions_Gestion <- full_join(Inv_fulljoin, Interactions, by = "Site_gestion_date_Quadrat")

Interactions_Classes <- left_join(Interactions_Gestion, Classes, by = "Sp_Pollinisateurs")

Interactions_Gestion$Sp_Plantes <- sub("_", " ", Interactions_Gestion$Sp_Plantes)
Interactions_Gestion$Sp_Pollinisateurs <- sub("_", " ", Interactions_Gestion$Sp_Pollinisateurs)
Interactions_Gestion$Sp_Plantes <- sub("_", " - ", Interactions_Gestion$Sp_Plantes)
Interactions_Gestion$Sp_Pollinisateurs <- sub("_", " - ", Interactions_Gestion$Sp_Pollinisateurs)
Interactions_Gestion$Sp_Plantes <- sub("._", " ", Interactions_Gestion$Sp_Plantes)
Interactions_Gestion$Sp_Plantes <- sub("_", " ", Interactions_Gestion$Sp_Plantes)
Interactions_Gestion$Sp_Pollinisateurs <- sub("_", " ", Interactions_Gestion$Sp_Pollinisateurs)

Interactions_Classes$Sp_Plantes <- sub("_", " ", Interactions_Classes$Sp_Plantes)
Interactions_Classes$Sp_Pollinisateurs <- sub("_", " ", Interactions_Classes$Sp_Pollinisateurs)
Interactions_Classes$Sp_Plantes <- sub("_", " - ", Interactions_Classes$Sp_Plantes)
Interactions_Classes$Sp_Pollinisateurs <- sub("_", " - ", Interactions_Classes$Sp_Pollinisateurs)
Interactions_Classes$Sp_Plantes <- sub("._", " ", Interactions_Classes$Sp_Plantes)
Interactions_Classes$Sp_Plantes <- sub("_", " ", Interactions_Classes$Sp_Plantes)
Interactions_Classes$Sp_Pollinisateurs <- sub("_", " ", Interactions_Classes$Sp_Pollinisateurs)

2.2.1.1 Tests

Interact_esp <- Interactions_Gestion %>% 
  group_by(Site_gestion_date, Sp_Plantes, Sp_Pollinisateurs) %>% 
  summarise(sum = sum(N_Interactions)) %>% 
  mutate(sum = as.numeric(sum))

network_Hemptinne_Tonte_Juin <- Interact_esp %>% 
  filter(Site_gestion_date == "Hemptinne_Tonte_Juin") %>% 
  select(Sp_Pollinisateurs,Sp_Plantes,sum) %>% 
  arrange(Sp_Pollinisateurs) %>% 
  pivot_wider(names_from = Sp_Pollinisateurs,
              values_from = sum,
              values_fill = 0) %>% 
  arrange(Sp_Plantes)

network_Mendel_Tonte_finJuillet <- Interact_esp %>% 
  filter(Site_gestion_date == "Mendel_Tonte_finJuilllet") %>% 
  select(Sp_Pollinisateurs,Sp_Plantes,sum) %>% 
  arrange(Sp_Pollinisateurs) %>% 
  pivot_wider(names_from = Sp_Pollinisateurs,
              values_from = sum,
              values_fill = 0) %>% 
  select(where(~ any(. != 0))) %>% 
  arrange(Sp_Plantes) %>% 
  as.data.frame() %>%
  column_to_rownames(var="Sp_Plantes")


network_Reaumur_Fauche_miJuillet <- Interact_esp %>% 
  filter(Site_gestion_date == "Reaumur_Fauche_miJuillet") %>% 
  filter(sum!=0) %>% 
  select(Sp_Pollinisateurs,Sp_Plantes,sum) %>% 
  arrange(Sp_Pollinisateurs) %>% 
  pivot_wider(names_from = Sp_Pollinisateurs,
              values_from = sum,
              values_fill = 0) %>% 
  select(where(~ any(. != 0))) %>% 
  arrange(Sp_Plantes) %>% 
  as.data.frame() %>%
  select(-Site_gestion_date) %>% 
  column_to_rownames(var="Sp_Plantes")

network_Reaumur_Fauche_miJuillet
# %>% 
#   kbl() %>% 
#   kable_classic(full_width = F, html_font = "Cambria")
plotweb(network_Reaumur_Fauche_miJuillet, text.rot = 90,y.width.high=0.07, y.width.low=0.07,y.lim=c(-0.5,2))

#plotweb(network_Reaumur_Fauche_miJuillet,col.high=rainbow(15),col.low=rainbow(8),text.rot=0,y.width.high=0.07, y.width.low=0.07,y.lim=c(-0.5,2))

networklevel(network_Reaumur_Fauche_miJuillet)
# %>% 
#   kbl() %>% 
#   kable_classic(full_width = F, html_font = "Cambria") 

2.2.2 Interactions

Interactions_Gestion %>% ggplot(aes (x = Gestion_2, y = N_Interactions, color = Gestion_2)) + 
  geom_boxplot(alpha = 0.70) +
  facet_wrap(~ Periode) + 
   scale_color_manual(values = c("Fauche" = "#aa1e0f",
                                "Tonte" = "#12661f")) +
  theme(legend.position = "none") +
  
Interactions_Gestion %>% ggplot(aes (x = Periode, y = N_Interactions, color = Periode)) + 
  geom_boxplot(alpha = 0.70) +
  facet_wrap(~ Gestion_2) + 
      scale_color_manual(values = c(Juin = "#74a9cf",
                                 `Mi-juillet` = "#2b8cbe",
                                 `Fin juillet` = "#045a8d")) +
  theme(legend.position = "none") 

Interactions_Gestion %>% ggplot(aes (x = Gestion_moment_5, y = N_Interactions, color = Gestion_moment_5)) + 
  geom_boxplot(alpha = 0.70) +
  facet_wrap(~ Periode) + 
    scale_color_manual(values = c("Graminées" = "#fbcb09",
                                  "Fleuri" = "#ff7207",
                                  "Semé" = "#de1e21",
                                  "Tonte récente" = "#6abe1d",
                                  "Tonte tardive" = "#2b790c")) + 
  theme(legend.position = "none") +
  
Interactions_Gestion %>% ggplot(aes (x = Periode, y = N_Interactions, color = Periode)) + 
  geom_boxplot(alpha = 0.70) +
  facet_wrap(~ Gestion_moment_5) + 
      scale_color_manual(values = c(Juin = "#74a9cf",
                                 `Mi-juillet` = "#2b8cbe",
                                 `Fin juillet` = "#045a8d")) +
  theme(legend.position = "none") 

Interactions_Gestion %>% ggplot(aes (x = Gestion_moment_5, y = N_Interactions, color = Periode)) + 
  geom_boxplot(alpha = 0.70) +
   scale_color_manual(values = c(Juin = "#74a9cf",
                                 `Mi-juillet` = "#2b8cbe",
                                 `Fin juillet` = "#045a8d")) + 
  theme(legend.position = "none") +

Interactions_Gestion %>% ggplot(aes (x = Periode, y = N_Interactions, color = Gestion_moment_5)) + 
  geom_boxplot(alpha = 0.70) +
    scale_color_manual(values = c("Graminées" = "#fbcb09",
                                  "Fleuri" = "#ff7207",
                                  "Semé" = "#de1e21",
                                  "Tonte récente" = "#6abe1d",
                                  "Tonte tardive" = "#2b790c")) + 
  theme(legend.position = "none") 

Interactions_Gestion %>% 
  group_by(Site_gestion_date, Periode, Gestion_moment_5) %>% 
  summarize(n= sum(N_Interactions)) %>% 
  ggplot(aes (x = Gestion_moment_5, y = n, color = Gestion_moment_5)) + 
  geom_boxplot(alpha = 0.70) +
  facet_wrap(~ Periode) +
    scale_color_manual(values = c("Graminées" = "#fbcb09",
                                  "Fleuri" = "#ff7207",
                                  "Semé" = "#de1e21",
                                  "Tonte récente" = "#6abe1d",
                                  "Tonte tardive" = "#2b790c")) + 
  theme(legend.position = "none") +
  
Interactions_Gestion %>% 
  group_by(Site_gestion_date, Periode, Gestion_moment_5) %>% 
  summarize(n= sum(N_Interactions)) %>% 
  ggplot(aes (x = Periode, y = n, color = Periode)) + 
  geom_boxplot(alpha = 0.70) +
  facet_wrap(~ Gestion_moment_5) +
   scale_color_manual(values = c(Juin = "#74a9cf",
                                 `Mi-juillet` = "#2b8cbe",
                                 `Fin juillet` = "#045a8d")) + 
  theme(legend.position = "none") 

Interactions_Gestion %>% 
  group_by(Site_gestion_date, Periode, Gestion_moment_5) %>% 
  summarize(n= sum(N_Interactions)) %>% 
  ggplot(aes (x = Periode, y = n, color = Gestion_moment_5)) + 
  geom_boxplot(alpha = 0.70) +
    scale_color_manual(values = c("Graminées" = "#fbcb09",
                                  "Fleuri" = "#ff7207",
                                  "Semé" = "#de1e21",
                                  "Tonte récente" = "#6abe1d",
                                  "Tonte tardive" = "#2b790c")) + 
  theme(legend.position = "none") +
  
Interactions_Gestion %>% 
  group_by(Site_gestion_date, Periode, Gestion_moment_5) %>% 
  summarize(n= sum(N_Interactions)) %>% 
  ggplot(aes (x = Gestion_moment_5, y = n, color = Periode)) + 
  geom_boxplot(alpha = 0.70) +
   scale_color_manual(values = c(Juin = "#74a9cf",
                                 `Mi-juillet` = "#2b8cbe",
                                 `Fin juillet` = "#045a8d")) + 
  theme(legend.position = "none") 

Interactions_Gestion %>% ggplot(aes (x = Qtte_Plantes, y = N_Interactions, color = Gestion_moment_5)) + 
  geom_point() + 
  geom_smooth(method = "glm", se = T) +
    scale_color_manual(values = c("Graminées" = "#fbcb09",
                                  "Fleuri" = "#ff7207",
                                  "Semé" = "#de1e21",
                                  "Tonte récente" = "#6abe1d",
                                  "Tonte tardive" = "#2b790c")) + 
  theme(legend.position = "none") 

2.2.3 For-Loop réseaux

Loop <-  Interactions_Gestion %>% 
  filter(Site_gestion_date != "Aula_Tonte_miJuillet",
         Site_gestion_date != "AvGL_Tonte_finJuillet",
         Site_gestion_date != "AvGL_Tonte_miJuillet",
         Site_gestion_date != "BlancsChevaux_Tonte_finJuillet",
         Site_gestion_date != "BlancsChevaux_Tonte_miJuillet",
         Site_gestion_date != "Curie_Tonte_miJuillet",
         Site_gestion_date != "Gare_bus_Tonte_finJuillet",
         Site_gestion_date != "Lauzelle_Fauche_Juin",
         Site_gestion_date != "Lauzelle_Fauche_miJuillet",
         Site_gestion_date != "Lavoisier_Fauche_miJuillet",
         Site_gestion_date != "Mendel_Tonte_finJuillet",
         Site_gestion_date != "Mendel_Tonte_miJuillet",
         Site_gestion_date != "Parc_Lapins_Fauche_Juin",
         Site_gestion_date != "Parc_Lapins_Fauche_miJuillet") %>% 
  mutate(Site_gestion_date = as.factor(Site_gestion_date),
         Sp_Plantes = as.factor(Sp_Plantes),
         Sp_Pollinisateurs = as.factor(Sp_Pollinisateurs))

loop_sum <- Loop %>% 
  group_by(Site_gestion_date, Sp_Plantes, Sp_Pollinisateurs) %>% 
  summarise(sum = sum(N_Interactions))

col_names <- colnames(loop_sum)
col_names <- col_names[-1]

par(font = 3)


for (x in levels(loop_sum$Site_gestion_date)) {
  pdf(paste0("Output/Reseaux_loop/Plots/", x, ".pdf")) # ouvrir le fichier
  plot_nw <- plotweb(loop_sum %>% 
                       filter(Site_gestion_date == x) %>% 
                       filter(sum!=0) %>% 
                       select(Sp_Pollinisateurs,Sp_Plantes,sum) %>% 
                       arrange(Sp_Pollinisateurs) %>% 
                       pivot_wider(names_from = Sp_Pollinisateurs,
                                   values_from = sum,
                                   values_fill = 0) %>% 
                       select(where(~ any(. != 0))) %>% 
                       arrange(Sp_Plantes) %>% 
                       as.data.frame() %>%
                       select(-Site_gestion_date) %>% 
                       column_to_rownames(var="Sp_Plantes"), 
                     high.lablength= 35, low.lablength=27,
                     text.rot=90, y.width.high=0.07, y.width.low=0.07, y.lim=c(-1,3))
  plot_nw # imprimer le graphique
  dev.off() # fermer le fichier 
}

for (x in levels(loop_sum$Site_gestion_date)) {
  nw_lv <- networklevel(loop_sum %>% 
                       filter(Site_gestion_date == x) %>% 
                       filter(sum!=0) %>% 
                       select(Sp_Pollinisateurs,Sp_Plantes,sum) %>% 
                       arrange(Sp_Pollinisateurs) %>% 
                       pivot_wider(names_from = Sp_Pollinisateurs,
                                   values_from = sum,
                                   values_fill = 0) %>% 
                       select(where(~ any(. != 0))) %>% 
                       arrange(Sp_Plantes) %>% 
                       as.data.frame() %>%
                       select(-Site_gestion_date) %>% 
                       column_to_rownames(var="Sp_Plantes"))
  write.csv2(nw_lv, file = paste0("Output/Reseaux_loop/Nw_Levels/", x, ".csv"))
}

2.2.4 Fauche vs Tonte G2

Interact_G2 <- Interactions_Gestion %>% 
  group_by(Gestion_2, Sp_Plantes, Sp_Pollinisateurs) %>% 
  summarise(sum = sum(N_Interactions)) %>% 
  mutate(sum = as.numeric(sum))

par(font = 3)
network_fauche <- Interact_G2 %>% 
  filter(Gestion_2 == "Fauche") %>%
  filter(sum!=0) %>% 
  select(Sp_Pollinisateurs,Sp_Plantes,sum) %>% 
  arrange(Sp_Pollinisateurs) %>% 
  pivot_wider(names_from = Sp_Pollinisateurs,
              values_from = sum,
              values_fill = 0) %>% 
  select(where(~ any(. != 0))) %>% 
  arrange(Sp_Plantes) %>% 
  as.data.frame() %>%
  select(-Gestion_2) %>% 
  column_to_rownames(var="Sp_Plantes")
# plotweb(network_fauche, high.lablength= 35, low.lablength=27, low.y = -0.1, high.y = 0.7, col.high=c("#aa1e0f"),col.low=c("#aa1e0f"), text.rot=90, y.width.high=0.07, y.width.low=0.07, y.lim=c(-1,2.5))
plotweb(network_fauche, col.high=c("#aa1e0f"),col.low=c("#aa1e0f"), text.rot=90, y.width.high=0.07, y.width.low=0.07, y.lim=c(-1,3.5))

#plotweb(network_fauche,col.high=c("black","yellow"),col.low=c("light green", "dark green"),text.rot=90,y.width.high=0.07, y.width.low=0.07,y.lim=c(-1,3))
#plotweb(network_fauche,col.high=rainbow(47),col.low=rainbow(47),text.rot=90,y.width.high=0.07, y.width.low=0.07,y.lim=c(-1,3))

# #plotweb(network_fauche, method = "normal",
#         col.interaction=c(rep("grey50", 2),"darkgoldenrod1",rep("grey50", 2), "white"), 
#         col.high = c(rep("grey50", 2),"darkgoldenrod1",rep("grey50", 2), "white"),  
#         bor.col.high = c(rep("grey50", 2),"darkgoldenrod1",rep("grey50", 2) ,"white"),
#         bor.col.interaction = c(rep("grey50", 2),"darkgoldenrod1",rep("grey50", 2), "white"), 
#         col.low=c("black", "white"), bor.col.low = c("black", "white"), 
#         text.high.col = c(rep("black", 5), "white"), text.low.col =  c("black", "white"),
#         text.rot = 90)
#title(main = "Réseau d'interaction fauche")

# networklevel(network_fauche, index=c("connectance", "web asymmetry", "weighted nestedness", "linkage density", "Fisher alpha","Shannon diversity", "interaction evenness","H2","robustness", "robustness", "generality")) %>% 
#   kbl() %>%
#   kable_classic(full_width = F, html_font = "Cambria")

network_tonte <- Interact_G2 %>% 
  filter(Gestion_2 == "Tonte") %>% 
  filter(sum!=0) %>% 
  select(Sp_Pollinisateurs,Sp_Plantes,sum) %>% 
  arrange(Sp_Pollinisateurs) %>% 
  pivot_wider(names_from = Sp_Pollinisateurs,
              values_from = sum,
              values_fill = 0) %>% 
  select(where(~ any(. != 0))) %>% 
  arrange(Sp_Plantes) %>% 
  as.data.frame() %>%
  select(-Gestion_2) %>% 
  column_to_rownames(var="Sp_Plantes")
plotweb(network_tonte,col.high=c("#12661f"),col.low=c("#12661f"),text.rot=90,y.width.high=0.07, y.width.low=0.07,y.lim=c(-1,3.5))

#plotweb(network_tonte,col.high=rainbow(40),col.low=rainbow(10),text.rot=90,y.width.high=0.07, y.width.low=0.07,y.lim=c(-1,3))

# networklevel(network_tonte, index=c("connectance", "web asymmetry", "weighted nestedness", "linkage density", "Fisher alpha","Shannon diversity", "interaction evenness","H2","robustness", "robustness", "generality")) %>% 
#   kbl() %>%
#   kable_classic(full_width = F, html_font = "Cambria")


Fauche <- networklevel(network_fauche, index=c("connectance", "web asymmetry", "weighted nestedness", "linkage density", "Fisher alpha","Shannon diversity", "interaction evenness","H2","robustness", "robustness", "generality")) 
Tonte <- networklevel(network_tonte, index=c("connectance", "web asymmetry", "weighted nestedness", "linkage density", "Fisher alpha","Shannon diversity", "interaction evenness","H2","robustness", "robustness", "generality"))
Table_NW_G2 <- cbind(Fauche, Tonte)
colnames(Table_NW_G2) <- c("Fauche", "Tonte")

Table_NW_G2
##                           Fauche      Tonte
## connectance            0.1181478  0.2943723
## web asymmetry          0.4590164  0.6500000
## weighted nestedness    0.6686565  0.4727312
## linkage density        6.9668799  2.1539505
## Fisher alpha         102.2384405 13.8299152
## Shannon diversity      4.5609652  1.6289212
## interaction evenness   0.5711813  0.2993010
## H2                     0.4291655  0.6866345
## robustness.HL          0.7905750  0.8376929
## robustness.LL          0.6427648  0.5099233
## generality.HL          5.2007056  1.3405415
## vulnerability.LL       8.7330541  2.9673596
# %>% 
#   kbl(caption = "Gestion - biclassification") %>%
#   kable_classic(full_width = F, html_font = "Cambria")  #%>% kable_styling() %>%
# save_kable(file = "Output/Tableau/NW_G2.pdf")

2.2.5 Gestion moment 5

Interact_Gm5 <- Interactions_Gestion %>% 
  group_by(Gestion_moment_5, Sp_Plantes, Sp_Pollinisateurs) %>% 
  summarise(sum = sum(N_Interactions)) %>% 
  mutate(sum = as.numeric(sum))

par(font = 3)
network_gram <- Interact_Gm5 %>% 
  filter(Gestion_moment_5 == "Graminées") %>%
  filter(sum!=0) %>% 
  select(Sp_Pollinisateurs,Sp_Plantes,sum) %>% 
  arrange(Sp_Pollinisateurs) %>% 
  pivot_wider(names_from = Sp_Pollinisateurs,
              values_from = sum,
              values_fill = 0) %>% 
  select(where(~ any(. != 0))) %>% 
  arrange(Sp_Plantes) %>% 
  as.data.frame() %>%
  select(-Gestion_moment_5) %>% 
  column_to_rownames(var="Sp_Plantes")
plotweb(network_gram, col.high=c("#fbcb09"),col.low=c("#fbcb09"), text.rot=90, y.width.high=0.07, y.width.low=0.07, y.lim=c(-1,3.5))

# networklevel(network_gram, index=c("connectance", "web asymmetry", "weighted nestedness", "linkage density", "Fisher alpha","Shannon diversity", "interaction evenness","H2","robustness", "robustness", "generality"))

network_fleuri <- Interact_Gm5 %>% 
  filter(Gestion_moment_5 == "Fleuri") %>%
  filter(sum!=0) %>% 
  select(Sp_Pollinisateurs,Sp_Plantes,sum) %>% 
  arrange(Sp_Pollinisateurs) %>% 
  pivot_wider(names_from = Sp_Pollinisateurs,
              values_from = sum,
              values_fill = 0) %>% 
  select(where(~ any(. != 0))) %>% 
  arrange(Sp_Plantes) %>% 
  as.data.frame() %>%
  select(-Gestion_moment_5) %>% 
  column_to_rownames(var="Sp_Plantes")
# plotweb(network_fleuri, col.high=c("#ff7207"),col.low=c("#ff7207"),high.lablength= 30, low.lablength=35, low.y = -0.25, text.rot=90, y.width.high=0.07, y.width.low=0.07, y.lim=c(-1,3.5))
plotweb(network_fleuri, col.high=c("#ff7207"),col.low=c("#ff7207"), text.rot=90, y.width.high=0.07, y.width.low=0.07, y.lim=c(-1,3.5))

# networklevel(network_fleuri, index=c("connectance", "web asymmetry", "weighted nestedness", "linkage density", "Fisher alpha","Shannon diversity", "interaction evenness","H2","robustness", "robustness", "generality"))

network_seme <- Interact_Gm5 %>% 
  filter(Gestion_moment_5 == "Semé") %>%
  filter(sum!=0) %>% 
  select(Sp_Pollinisateurs,Sp_Plantes,sum) %>% 
  arrange(Sp_Pollinisateurs) %>% 
  pivot_wider(names_from = Sp_Pollinisateurs,
              values_from = sum,
              values_fill = 0) %>% 
  select(where(~ any(. != 0))) %>% 
  arrange(Sp_Plantes) %>% 
  as.data.frame() %>%
  select(-Gestion_moment_5) %>% 
  column_to_rownames(var="Sp_Plantes")
plotweb(network_seme, col.high=c("#de1e21"),col.low=c("#de1e21"), text.rot=90, y.width.high=0.07, y.width.low=0.07, y.lim=c(-1,3.5))

# networklevel(network_seme, index=c("connectance", "web asymmetry", "weighted nestedness", "linkage density", "Fisher alpha","Shannon diversity", "interaction evenness","H2","robustness", "robustness", "generality"))

network_TonRec <- Interact_Gm5 %>% 
  filter(Gestion_moment_5 == "Tonte récente") %>%
  filter(sum!=0) %>% 
  select(Sp_Pollinisateurs,Sp_Plantes,sum) %>% 
  arrange(Sp_Pollinisateurs) %>% 
  pivot_wider(names_from = Sp_Pollinisateurs,
              values_from = sum,
              values_fill = 0) %>% 
  select(where(~ any(. != 0))) %>% 
  arrange(Sp_Plantes) %>% 
  as.data.frame() %>%
  select(-Gestion_moment_5) %>% 
  column_to_rownames(var="Sp_Plantes")
plotweb(network_TonRec, col.high=c("#6abe1d"), col.low=c("#6abe1d"), text.rot=90, y.width.high=0.07, y.width.low=0.07, y.lim=c(-1,3.5))

# networklevel(network_TonRec, index=c("connectance", "web asymmetry", "weighted nestedness", "linkage density", "Fisher alpha","Shannon diversity", "interaction evenness","H2","robustness", "robustness", "generality"))

network_TonTard <- Interact_Gm5 %>% 
  filter(Gestion_moment_5 == "Tonte tardive") %>%
  filter(sum!=0) %>% 
  select(Sp_Pollinisateurs,Sp_Plantes,sum) %>% 
  arrange(Sp_Pollinisateurs) %>% 
  pivot_wider(names_from = Sp_Pollinisateurs,
              values_from = sum,
              values_fill = 0) %>% 
  select(where(~ any(. != 0))) %>% 
  arrange(Sp_Plantes) %>% 
  as.data.frame() %>%
  select(-Gestion_moment_5) %>% 
  column_to_rownames(var="Sp_Plantes")
plotweb(network_TonTard, col.high=c("#2b790c"), col.low=c("#2b790c"), text.rot=90, y.width.high=0.07, y.width.low=0.07, y.lim=c(-1,3.5))

# networklevel(network_TonTard, index=c("connectance", "web asymmetry", "weighted nestedness", "linkage density", "Fisher alpha","Shannon diversity", "interaction evenness","H2","robustness", "robustness", "generality"))


Graminees <- networklevel(network_gram, index=c("connectance", "web asymmetry", "weighted nestedness", "linkage density", "Fisher alpha","Shannon diversity", "interaction evenness","H2","robustness", "robustness", "generality")) %>% 
  as.data.frame()
Fleuri <- networklevel(network_fleuri, index=c("connectance", "web asymmetry", "weighted nestedness", "linkage density", "Fisher alpha","Shannon diversity", "interaction evenness","H2","robustness", "robustness", "generality"))%>% 
  as.data.frame()
Seme <- networklevel(network_seme, index=c("connectance", "web asymmetry", "weighted nestedness", "linkage density", "Fisher alpha","Shannon diversity", "interaction evenness","H2","robustness", "robustness", "generality")) %>% 
  as.data.frame()
Tonte_recente <- networklevel(network_TonRec, index=c("connectance", "web asymmetry", "weighted nestedness", "linkage density", "Fisher alpha","Shannon diversity", "interaction evenness","H2","robustness", "robustness", "generality"))%>% 
  as.data.frame()
Tonte_tardive <- networklevel(network_TonTard, index=c("connectance", "web asymmetry", "weighted nestedness", "linkage density", "Fisher alpha","Shannon diversity", "interaction evenness","H2","robustness", "robustness", "generality")) %>% 
  as.data.frame()

Table_NW_G5 <- cbind(Graminees, Fleuri, Seme, Tonte_recente, Tonte_tardive)
colnames(Table_NW_G5) <- c("Graminées", "Fleuri", "Semé", "Tonte récente", "Tonte tardive")
Table_NW_G5 
##                       Graminées     Fleuri       Semé Tonte récente
## connectance           0.2407407  0.1142534  0.1418764     0.4722222
## web asymmetry         0.6363636  0.4468085  0.4250000     0.6000000
## weighted nestedness   0.3958483  0.5646260  0.6423572     0.3757457
## linkage density       4.5620168  5.5351438  4.9818744     1.9228986
## Fisher alpha         15.7290348 71.1656509 54.1504976     4.6059563
## Shannon diversity     3.2435071  4.2667950  3.8437780     1.2878123
## interaction evenness  0.6375323  0.5706099  0.5354536     0.3593709
## H2                    0.7336450  0.5114385  0.4496612     0.8104420
## robustness.HL         0.8052689  0.7730934  0.7710849     0.7025725
## robustness.LL         0.4016080  0.6190162  0.6374439     0.3201852
## generality.HL         1.4745200  3.8796971  3.3251203     1.1012144
## vulnerability.LL      7.6495137  7.1905906  6.6386285     2.7445828
##                      Tonte tardive
## connectance              0.2857143
## web asymmetry            0.6500000
## weighted nestedness      0.4584951
## linkage density          2.1270847
## Fisher alpha            13.6693767
## Shannon diversity        1.6404026
## interaction evenness     0.3014106
## H2                       0.6990216
## robustness.HL            0.8498949
## robustness.LL            0.5047716
## generality.HL            1.3308515
## vulnerability.LL         2.9233178
# %>%
#   kbl(caption = "Gestion - pentaclassification") %>%
#   kable_classic(full_width = F, html_font = "Cambria") 

2.2.6 Période

Interact_Periode <- Interactions_Gestion %>% 
  group_by(Periode, Sp_Plantes, Sp_Pollinisateurs) %>% 
  summarise(sum = sum(N_Interactions)) %>% 
  mutate(sum = as.numeric(sum))

par(font = 3)

network_Juin <- Interact_Periode %>% 
  filter(Periode == "Juin") %>%
  filter(sum!=0) %>% 
  select(Sp_Pollinisateurs,Sp_Plantes,sum) %>% 
  arrange(Sp_Pollinisateurs) %>% 
  pivot_wider(names_from = Sp_Pollinisateurs,
              values_from = sum,
              values_fill = 0) %>% 
  select(where(~ any(. != 0))) %>% 
  arrange(Sp_Plantes) %>% 
  as.data.frame() %>%
  select(-Periode) %>% 
  column_to_rownames(var="Sp_Plantes")
plotweb(network_Juin, col.high=c("#74a9cf"), col.low=c("#74a9cf"), text.rot=90, y.width.high=0.07, y.width.low=0.07, y.lim=c(-1,3.5))

# networklevel(network_Juin, index=c("connectance", "web asymmetry", "weighted nestedness", "linkage density", "Fisher alpha","Shannon diversity", "interaction evenness","H2","robustness", "robustness", "generality"))

network_miJuil <- Interact_Periode %>% 
  filter(Periode == "Mi-juillet") %>%
  filter(sum!=0) %>% 
  select(Sp_Pollinisateurs,Sp_Plantes,sum) %>% 
  arrange(Sp_Pollinisateurs) %>% 
  pivot_wider(names_from = Sp_Pollinisateurs,
              values_from = sum,
              values_fill = 0) %>% 
  select(where(~ any(. != 0))) %>% 
  arrange(Sp_Plantes) %>% 
  as.data.frame() %>%
  select(-Periode) %>% 
  column_to_rownames(var="Sp_Plantes")
plotweb(network_miJuil, col.high=c("#2b8cbe"), col.low=c("#2b8cbe"), text.rot=90, y.width.high=0.07, y.width.low=0.07, y.lim=c(-1,3.5))

# networklevel(network_miJuil, index=c("connectance", "web asymmetry", "weighted nestedness", "linkage density", "Fisher alpha","Shannon diversity", "interaction evenness","H2","robustness", "robustness", "generality"))

network_finJuil <- Interact_Periode %>% 
  filter(Periode == "Fin juillet") %>%
  filter(sum!=0) %>% 
  select(Sp_Pollinisateurs,Sp_Plantes,sum) %>% 
  arrange(Sp_Pollinisateurs) %>% 
  pivot_wider(names_from = Sp_Pollinisateurs,
              values_from = sum,
              values_fill = 0) %>% 
  select(where(~ any(. != 0))) %>% 
  arrange(Sp_Plantes) %>% 
  as.data.frame() %>%
  select(-Periode) %>% 
  column_to_rownames(var="Sp_Plantes")
plotweb(network_finJuil, col.high=c("#045a8d"), col.low=c("#045a8d"), text.rot=90, y.width.high=0.07, y.width.low=0.07, y.lim=c(-1,3.5))

# networklevel(network_finJuil, index=c("connectance", "web asymmetry", "weighted nestedness", "linkage density", "Fisher alpha","Shannon diversity", "interaction evenness","H2","robustness", "robustness", "generality"))



juin <- networklevel(network_Juin, index=c("connectance", "web asymmetry", "weighted nestedness", "linkage density", "Fisher alpha","Shannon diversity", "interaction evenness","H2","robustness", "robustness", "generality")) 
mijuillet <- networklevel(network_miJuil, index=c("connectance", "web asymmetry", "weighted nestedness", "linkage density", "Fisher alpha","Shannon diversity", "interaction evenness","H2","robustness", "robustness", "generality"))
finjuillet <- networklevel(network_finJuil, index=c("connectance", "web asymmetry", "weighted nestedness", "linkage density", "Fisher alpha","Shannon diversity", "interaction evenness","H2","robustness", "robustness", "generality")) 

Table_NW_P <- cbind(juin, mijuillet, finjuillet)
colnames(Table_NW_P) <- c("Juin", "Mi-juillet", "Fin juillet")
Table_NW_P 
##                            Juin Mi-juillet Fin juillet
## connectance           0.1352785  0.1303030   0.1064815
## web asymmetry         0.3809524  0.3924051   0.3846154
## weighted nestedness   0.5246653  0.5805779   0.5296713
## linkage density       4.7004410  4.2604178   3.6859752
## Fisher alpha         61.9488092 44.7255342  40.7488484
## Shannon diversity     3.7803507  3.5367435   3.1842605
## interaction evenness  0.5165444  0.4922134   0.4442924
## H2                    0.5157954  0.4665388   0.5867317
## robustness.HL         0.7788051  0.7668089   0.7323744
## robustness.LL         0.6363928  0.6371332   0.5838619
## generality.HL         3.9909709  3.5874657   3.0955332
## vulnerability.LL      5.4099111  4.9333699   4.2764171
# %>%
#   kbl(caption = "Période") %>%
#   kable_classic(full_width = F, html_font = "Cambria") 

2.2.7 Période x Gestion moment 2

Interact_Periode_g2 <- Interactions_Gestion %>% 
  group_by(Periode, Gestion_2, Sp_Plantes, Sp_Pollinisateurs) %>% 
  summarise(sum = sum(N_Interactions)) %>% 
  mutate(sum = as.numeric(sum))

par(font = 3)

network_Juin_fauche <- Interact_Periode_g2 %>% 
  filter(Periode == "Juin" &
         Gestion_2 == "Fauche") %>%
  filter(sum!=0) %>% 
  select(Sp_Pollinisateurs,Sp_Plantes,sum) %>% 
  arrange(Sp_Pollinisateurs) %>% 
  pivot_wider(names_from = Sp_Pollinisateurs,
              values_from = sum,
              values_fill = 0) %>% 
  select(where(~ any(. != 0))) %>% 
  arrange(Sp_Plantes) %>% 
  as.data.frame() %>%
  select(-Periode) %>% 
  select(-Gestion_2) %>% 
  column_to_rownames(var="Sp_Plantes")
plotweb(network_Juin_fauche, col.high=c("#74a9cf","#aa1e0f"), col.low=c("#74a9cf","#aa1e0f"), text.rot=90, y.width.high=0.07, y.width.low=0.07, y.lim=c(-1,3))

networklevel(network_Juin_fauche, index=c("connectance", "web asymmetry", "weighted nestedness", "linkage density", "Fisher alpha","Shannon diversity", "interaction evenness","H2","robustness", "robustness", "generality"))
##          connectance        web asymmetry  weighted nestedness 
##            0.1272727            0.3580247            0.5479423 
##      linkage density         Fisher alpha    Shannon diversity 
##            5.9304150           68.8198247            4.4090059 
## interaction evenness                   H2        robustness.HL 
##            0.6068472            0.4613997            0.7640749 
##        robustness.LL        generality.HL     vulnerability.LL 
##            0.6321896            4.6183087            7.2425214
network_Juin_tonte <- Interact_Periode_g2 %>% 
  filter(Periode == "Juin" &
         Gestion_2 == "Tonte") %>%
  filter(sum!=0) %>% 
  select(Sp_Pollinisateurs,Sp_Plantes,sum) %>% 
  arrange(Sp_Pollinisateurs) %>% 
  pivot_wider(names_from = Sp_Pollinisateurs,
              values_from = sum,
              values_fill = 0) %>% 
  select(where(~ any(. != 0))) %>% 
  arrange(Sp_Plantes) %>% 
  as.data.frame() %>%
  select(-Periode) %>% 
  select(-Gestion_2) %>% 
  column_to_rownames(var="Sp_Plantes")
plotweb(network_Juin_tonte, col.high=c("#74a9cf","#12661f"), col.low=c("#74a9cf","#12661f"), text.rot=90, y.width.high=0.07, y.width.low=0.07, y.lim=c(-1,3))

networklevel(network_Juin_tonte, index=c("connectance", "web asymmetry", "weighted nestedness", "linkage density", "Fisher alpha","Shannon diversity", "interaction evenness","H2","robustness", "robustness", "generality"))
##          connectance        web asymmetry  weighted nestedness 
##            0.3115942            0.5862069            0.4124064 
##      linkage density         Fisher alpha    Shannon diversity 
##            2.0355532           10.0881095            1.7214311 
## interaction evenness                   H2        robustness.HL 
##            0.3493693            0.7407693            0.7764011 
##        robustness.LL        generality.HL     vulnerability.LL 
##            0.4487474            1.3961494            2.6749570
network_miJui_fauche <- Interact_Periode_g2 %>% 
  filter(Periode == "Mi-juillet" &
         Gestion_2 == "Fauche") %>%
  filter(sum!=0) %>% 
  select(Sp_Pollinisateurs,Sp_Plantes,sum) %>% 
  arrange(Sp_Pollinisateurs) %>% 
  pivot_wider(names_from = Sp_Pollinisateurs,
              values_from = sum,
              values_fill = 0) %>% 
  select(where(~ any(. != 0))) %>% 
  arrange(Sp_Plantes) %>% 
  as.data.frame() %>%
  select(-Periode) %>% 
  select(-Gestion_2) %>% 
  column_to_rownames(var="Sp_Plantes")
plotweb(network_miJui_fauche, col.high=c("#2b8cbe","#aa1e0f"), col.low=c("#2b8cbe","#aa1e0f"), text.rot=90, y.width.high=0.07, y.width.low=0.07, y.lim=c(-1,3))

networklevel(network_miJui_fauche, index=c("connectance", "web asymmetry", "weighted nestedness", "linkage density", "Fisher alpha","Shannon diversity", "interaction evenness","H2","robustness", "robustness", "generality"))
##          connectance        web asymmetry  weighted nestedness 
##            0.1279264            0.3866667            0.5894706 
##      linkage density         Fisher alpha    Shannon diversity 
##            4.5996354           43.6299928            3.7923862 
## interaction evenness                   H2        robustness.HL 
##            0.5351385            0.5190806            0.7505902 
##        robustness.LL        generality.HL     vulnerability.LL 
##            0.6165338            3.6206267            5.5786441
network_miJui_tonte <- Interact_Periode_g2 %>% 
  filter(Periode == "Mi-juillet" &
         Gestion_2 == "Tonte") %>%
  filter(sum!=0) %>% 
  select(Sp_Pollinisateurs,Sp_Plantes,sum) %>% 
  arrange(Sp_Pollinisateurs) %>% 
  pivot_wider(names_from = Sp_Pollinisateurs,
              values_from = sum,
              values_fill = 0) %>% 
  select(where(~ any(. != 0))) %>% 
  arrange(Sp_Plantes) %>% 
  as.data.frame() %>%
  select(-Periode) %>% 
  select(-Gestion_2) %>% 
  column_to_rownames(var="Sp_Plantes")
plotweb(network_miJui_tonte, col.high=c("#2b8cbe","#12661f"), col.low=c("#2b8cbe","#12661f"), text.rot=90, y.width.high=0.07, y.width.low=0.07, y.lim=c(-1,3))

networklevel(network_miJui_tonte, index=c("connectance", "web asymmetry", "weighted nestedness", "linkage density", "Fisher alpha","Shannon diversity", "interaction evenness","H2","robustness", "robustness", "generality"))
##          connectance        web asymmetry  weighted nestedness 
##            0.3000000            0.5652174            0.5032866 
##      linkage density         Fisher alpha    Shannon diversity 
##            2.1902785            5.7177643            1.4246274 
## interaction evenness                   H2        robustness.HL 
##            0.3165973            0.7622993            0.7245617 
##        robustness.LL        generality.HL     vulnerability.LL 
##            0.3952795            1.1260362            3.2545208
network_finJui_fauche <- Interact_Periode_g2 %>% 
  filter(Periode == "Fin juillet" &
         Gestion_2 == "Fauche") %>%
  filter(sum!=0) %>% 
  select(Sp_Pollinisateurs,Sp_Plantes,sum) %>% 
  arrange(Sp_Pollinisateurs) %>% 
  pivot_wider(names_from = Sp_Pollinisateurs,
              values_from = sum,
              values_fill = 0) %>% 
  select(where(~ any(. != 0))) %>% 
  arrange(Sp_Plantes) %>% 
  as.data.frame() %>%
  select(-Periode) %>% 
  select(-Gestion_2) %>% 
  column_to_rownames(var="Sp_Plantes")
plotweb(network_finJui_fauche, col.high=c("#045a8d","#aa1e0f"), col.low=c("#045a8d","#aa1e0f"), text.rot=90, y.width.high=0.07, y.width.low=0.07, y.lim=c(-1,3))

networklevel(network_finJui_fauche, index=c("connectance", "web asymmetry", "weighted nestedness", "linkage density", "Fisher alpha","Shannon diversity", "interaction evenness","H2","robustness", "robustness", "generality"))
##          connectance        web asymmetry  weighted nestedness 
##            0.1072727            0.3888889            0.5493924 
##      linkage density         Fisher alpha    Shannon diversity 
##            4.7715399           42.7795835            3.9215302 
## interaction evenness                   H2        robustness.HL 
##            0.5599734            0.5423388            0.7005818 
##        robustness.LL        generality.HL     vulnerability.LL 
##            0.5953805            3.1904334            6.3526464
network_finJui_tonte <- Interact_Periode_g2 %>% 
  filter(Periode == "Fin juillet" &
         Gestion_2 == "Tonte") %>%
  filter(sum!=0) %>% 
  select(Sp_Pollinisateurs,Sp_Plantes,sum) %>% 
  arrange(Sp_Pollinisateurs) %>% 
  pivot_wider(names_from = Sp_Pollinisateurs,
              values_from = sum,
              values_fill = 0) %>% 
  select(where(~ any(. != 0))) %>% 
  arrange(Sp_Plantes) %>% 
  as.data.frame() %>%
  select(-Periode) %>% 
  select(-Gestion_2) %>% 
  column_to_rownames(var="Sp_Plantes")
plotweb(network_finJui_tonte, col.high=c("#045a8d","#12661f"), col.low=c("#045a8d","#12661f"), text.rot=90, y.width.high=0.07, y.width.low=0.07, y.lim=c(-1,3))

networklevel(network_finJui_tonte, index=c("connectance", "web asymmetry", "weighted nestedness", "linkage density", "Fisher alpha","Shannon diversity", "interaction evenness","H2","robustness", "robustness", "generality"))
##          connectance        web asymmetry  weighted nestedness 
##            0.2368421            0.5200000            0.4073270 
##      linkage density         Fisher alpha    Shannon diversity 
##            1.4223746            6.0066788            0.9281065 
## interaction evenness                   H2        robustness.HL 
##            0.1959602            0.7960476            0.7000583 
##        robustness.LL        generality.HL     vulnerability.LL 
##            0.4198334            1.2289000            1.6158491

2.3 Expérience supplémentaire: Tonte

#Mise en facteur des variables 
expe_Tonte = expe_Tonte %>% 
  mutate(Site = as.factor(Site),
         Date = as.factor(Date))

#Tonte$Date <- dmy(Tonte$Date)
summary(expe_Tonte)

expe_Tonte$S <- specnumber(expe_Tonte[5:11])
expe_Tonte$Ab <- rowSums(expe_Tonte[5:11])


# mettre une ligne par espèce
Tonte_pl <- expe_Tonte %>%
  pivot_longer(cols = Bellis_perennis:Trifolium_repens,
               names_to = "Espèces",
               values_to = "Qtté")

Tonte_pl$Qtte_trans <- Tonte_pl$Qtté
Tonte_pl[Tonte_pl == 0] <- NA
expe_Tonte %>% ggplot(aes (x = Jour_af_tonte, y = Ab, color=Site)) + 
  geom_line() +  
  labs(title = "Abondance de fleurs après la tonte selon les sites" , x = "Jour après la tonte", y = "Abondance de fleurs") +
      theme(legend.position="bottom") +
expe_Tonte %>% ggplot(aes (x = Jour_af_tonte, y = Ab, color=Site)) + 
  geom_smooth()+
  labs(title = "Abondance de fleurs après la tonte selon les sites" , x = "Jour après la tonte", y = "Abondance de fleurs") +
      theme(legend.position="none")

Tonte_pl %>% ggplot(aes (x = Jour_af_tonte, y = S)) + 
  facet_wrap(~Site) +
  geom_smooth(se = F)+
  labs(title = "Abondance de fleurs après la tonte selon les sites" , x = "Jour après la tonte", y = "Abondance de fleurs") +
      theme(legend.position="bottom") +
Tonte_pl %>% ggplot(aes (x = Jour_af_tonte, y = S, color = Site)) + 
  geom_point() +
  geom_smooth(se = F)+
  labs(title = "Richesse spécifique en fleurs après la tonte selon les sites" , x = "Jour après la tonte", y = "Richesse spécifique en fleurs") +
      theme(legend.position="bottom")

Tonte_pl %>% ggplot(aes (x = Jour_af_tonte, y = Qtté, color=Espèces)) + 
  geom_smooth(se=F)+
  labs(title = "Abondance de fleurs après la tonte selon les sites" , x = "Jour après la tonte", y = "Abondance de fleurs") +
      theme(legend.position="bottom") 

Tonte_pl %>% ggplot(aes (x = Jour_af_tonte, y = Qtté, color=Espèces)) + 
  facet_wrap(~Site) +
  geom_smooth(se = F)+
  labs(title = "Abondance de fleurs après la tonte selon les sites" , x = "Jour après la tonte", y = "Abondance de fleurs") +
      theme(legend.position="bottom")

3 Statistiques

3.1 Multivariée

3.1.1 ACP

3.1.1.1 ACP - Inv

gestion_2 <- as.factor(Inv$Gestion_2)
gestion_5 <- as.factor(Inv$Gestion_moment_5)
periode <- as.factor(Inv$Periode)
activite <- as.factor(Inv$Activite)
meteo <- as.factor(Inv$Meteo)
site <- as.factor(Inv$Site)
quartier <- as.factor(Inv$Quartier)

NumVar <- sapply(Inv, is.numeric)
df <- Inv[,NumVar] # %>% 
  # select(!c(Heure_fin,Heure_debut))
n <- nrow(df) 
p <- ncol(df)

acp <- dudi.pca(df, scannf = F, nf = p)
fviz_pca_biplot(acp)

screeplot(acp, main = "Valeurs propres")

fviz_pca_var(acp, 
             col.var = "cos2", 
             title = "Cercle de corrélation et qualité de représentation dans le plan 1-2", 
             gradient.cols=c("red", "gold", "forestgreen")) 

fviz_pca_var(acp, 
             col.var = "cos2", axes = c(2,3),
             title = "Cercle de corrélation et qualité de représentation dans le plan 2-3", 
             gradient.cols=c("red", "gold", "forestgreen")) 

fviz_pca_var(acp, 
             col.var = "cos2", axes = c(4,5),
             title = "Cercle de corrélation et qualité de représentation dans le plan 4-5",
             gradient.cols=c("red", "gold", "forestgreen")) 

fviz_pca_var(acp, 
             col.var = "cos2", axes = c(5,6),
             title = "Cercle de corrélation et qualité de représentation dans le plan 5-6", 
             gradient.cols=c("red", "gold", "forestgreen"))

fviz_pca_ind(acp, repel = T,
             labelsize = 2, 
             col.ind = "cos2", 
             gradient.cols=c("red", "gold", "forestgreen"),
             title = "Qualité de représentation des individus dans le plan 1-2")

fviz_pca_ind(acp, axes = c(2,3), 
             labelsize = 0, 
             col.ind = "cos2", 
             gradient.cols=c("red", "gold", "forestgreen"),
             title = "Qualité de représentation des individus dans le plan 2-3")

fviz_pca_ind(acp, 
             labelsize = 0, 
             col.ind = gestion_2, 
             addEllipses = T,
             title = "Position des individus dans le plan 1-2 selon la variable gestion_2") +
      aes(color = gestion_2, shape = gestion_2, fill = gestion_2) + 
    scale_shape_manual(values = c("Fauche" = 16,
                                  "Tonte" = 5)) +
    scale_color_manual(values = c("Fauche" = "#aa1e0f",
                                "Tonte" = "#12661f")) +
   scale_fill_manual(values = c("Fauche" = "#aa1e0f",
                                "Tonte" = "#12661f")) 

fviz_pca_ind(acp, 
             labelsize = 0, 
             col.ind = gestion_5, 
             addEllipses = T,
             title = "Position des individus dans le plan 1-2 selon la variable gestion_5") +
  aes(color = gestion_5, shape = gestion_5, fill = gestion_5)+ 
  scale_color_manual(values = c("Graminées" = "#fbcb09",
                                  "Fleuri" = "#ff7207",
                                  "Semé" = "#de1e21",
                                  "Tonte récente" = "#6abe1d",
                                  "Tonte tardive" = "#2b790c")) +
  scale_fill_manual(values = c("Graminées" = "#fbcb09",
                                  "Fleuri" = "#ff7207",
                                  "Semé" = "#de1e21",
                                  "Tonte récente" = "#6abe1d",
                                  "Tonte tardive" = "#2b790c")) +
  scale_shape_manual(values = c("Graminées" = 16,
                                  "Fleuri" = 17,
                                  "Semé" = 15,
                                  "Tonte récente" = 5,
                                  "Tonte tardive" = 6)) 

fviz_pca_ind(acp, 
             labelsize = 0, 
             col.ind = periode, 
             addEllipses = T,
             title = "Position des individus dans le plan 1-2 selon la variable periode") +
    aes(color = periode, shape = periode, fill = periode) +
      scale_color_manual(values = c(Juin = "#74a9cf",
                                 `Mi-juillet` = "#2b8cbe",
                                 `Fin juillet` = "#045a8d")) +
  scale_fill_manual(values = c(Juin = "#74a9cf",
                                 `Mi-juillet` = "#2b8cbe",
                                 `Fin juillet` = "#045a8d"))

fviz_pca_ind(acp, col.var = "var",
             labelsize = 0, 
             col.ind = activite, 
             addEllipses = T,
             title = "Position des individus dans le plan 1-2 selon la variable activite") +
aes(color = activite, shape = activite, fill = activite) +
    scale_color_manual(values = c("Forte" = "#3f007d",
                                "Moyenne" = "#6a51a3",
                                "Nulle" = "#9e9ac8")) +
    scale_fill_manual(values = c("Forte" = "#3f007d",
                                "Moyenne" = "#6a51a3",
                                "Nulle" = "#9e9ac8")) 

fviz_pca_ind(acp, 
             labelsize = 0, 
             col.ind = meteo, 
             addEllipses = T,
             title = "Position des individus dans le plan 1-2 selon la variable meteo") +
    aes(color = meteo, shape = meteo, fill = meteo) +
    scale_color_manual(values = c("Nuageux" = "#7f908c",
                                "Alternances" = "#79ccbd",
                                "Soleil" = "#fbcb09")) +
    scale_fill_manual(values = c("Nuageux" = "#7f908c",
                                "Alternances" = "#79ccbd",
                                "Soleil" = "#fbcb09")) 

fviz_pca_ind(acp, 
             labelsize = 0, 
             col.ind = quartier, 
             addEllipses = T,
             title = "Position des individus dans le plan 1-2 selon la variable quartier") 

summary(acp)
## Class: pca dudi
## Call: dudi.pca(df = df, scannf = F, nf = p)
## 
## Total inertia: 7
## 
## Eigenvalues:
##     Ax1     Ax2     Ax3     Ax4     Ax5 
##  3.4909  1.2737  0.7696  0.6520  0.4721 
## 
## Projected inertia (%):
##     Ax1     Ax2     Ax3     Ax4     Ax5 
##  49.871  18.195  10.995   9.314   6.745 
## 
## Cumulative projected inertia (%):
##     Ax1   Ax1:2   Ax1:3   Ax1:4   Ax1:5 
##   49.87   68.07   79.06   88.37   95.12 
## 
## (Only 5 dimensions (out of 7) are shown)
A <- fviz_pca_ind(acp, 
             labelsize = 0, 
             col.ind = gestion_2, 
             addEllipses = T,
             title = "Position des parcelles dans le plan 1-2 selon la variable gestion_2") +
      aes(color = gestion_2, shape = gestion_2, fill = gestion_2) + 
    scale_shape_manual(values = c("Fauche" = 16,
                                  "Tonte" = 5)) +
    scale_color_manual(values = c("Fauche" = "#aa1e0f",
                                "Tonte" = "#12661f")) +
   scale_fill_manual(values = c("Fauche" = "#aa1e0f",
                                "Tonte" = "#12661f")) +
  labs(color = "Type de gestion", fill = "Type de gestion", shape = "Type de gestion")

B <- fviz_pca_ind(acp, 
             labelsize = 0, 
             col.ind = gestion_5, 
             addEllipses = T,
             title = "Position des parcelles dans le plan 1-2 selon la variable gestion_5") +
    aes(color = gestion_5, shape = gestion_5, fill = gestion_5)+ 
  scale_color_manual(values = c("Graminées" = "#fbcb09",
                                  "Fleuri" = "#ff7207",
                                  "Semé" = "#de1e21",
                                  "Tonte récente" = "#6abe1d",
                                  "Tonte tardive" = "#2b790c")) +
  scale_fill_manual(values = c("Graminées" = "#fbcb09",
                                  "Fleuri" = "#ff7207",
                                  "Semé" = "#de1e21",
                                  "Tonte récente" = "#6abe1d",
                                  "Tonte tardive" = "#2b790c")) +
  scale_shape_manual(values = c("Graminées" = 16,
                                  "Fleuri" = 17,
                                  "Semé" = 15,
                                  "Tonte récente" = 5,
                                  "Tonte tardive" = 6))  +
  labs(color = "Type de gestion", fill = "Type de gestion", shape = "Type de gestion")


C <- fviz_pca_ind(acp, 
             labelsize = 0, 
             col.ind = periode, 
             addEllipses = T,
             title = "Position des parcelles dans le plan 1-2 selon la variable periode") +
    aes(color = periode, shape = periode, fill = periode) +
      scale_color_manual(values = c(Juin = "#74a9cf",
                                 `Mi-juillet` = "#2b8cbe",
                                 `Fin juillet` = "#045a8d")) +
  scale_fill_manual(values = c(Juin = "#74a9cf",
                                 `Mi-juillet` = "#2b8cbe",
                                 `Fin juillet` = "#045a8d")) +
  labs(color = "Période", fill = "Période", shape = "Période")

D <- fviz_pca_var(acp, 
             col.var = "cos2", 
             title = "Cercle de corrélation et qualité de représentation dans le plan 1-2", 
             gradient.cols=c("red", "gold", "forestgreen"))


(D+B)/(C+A) 

A <- fviz_pca_ind(acp, 
             labelsize = 0, 
             col.ind = quartier, 
             addEllipses = T,
             palette = terrain.colors(10),
             title = "Position des parcelles dans le plan 1-2 selon la variable quartier") +
  labs(color = "Quartier", fill = "Quartier", shape = "Quartier")

B <- fviz_pca_ind(acp, 
             labelsize = 0, 
             col.ind = activite, 
             addEllipses = T,
             #palette = terrain.colors(5),
             title = "Position des parcelles dans le plan 1-2 selon la variable activite") +
aes(color = activite, shape = activite, fill = activite) +
    scale_color_manual(values = c("Forte" = "#3f007d",
                                "Moyenne" = "#6a51a3",
                                "Nulle" = "#9e9ac8")) +
    scale_fill_manual(values = c("Forte" = "#3f007d",
                                "Moyenne" = "#6a51a3",
                                "Nulle" = "#9e9ac8")) +
  labs(color = "Activité", fill = "Activité", shape = "Activité")


C <- fviz_pca_ind(acp, 
             labelsize = 0, 
             col.ind = meteo, 
             addEllipses = T,
             #palette = terrain.colors(5),
             title = "Position des parcelles dans le plan 1-2 selon la variable meteo") +
    aes(color = meteo, shape = meteo, fill = meteo) +
    scale_color_manual(values = c("Nuageux" = "#7f908c",
                                "Alternances" = "#79ccbd",
                                "Soleil" = "#fbcb09")) +
    scale_fill_manual(values = c("Nuageux" = "#7f908c",
                                "Alternances" = "#79ccbd",
                                "Soleil" = "#fbcb09"))  +
  labs(color = "Météo", fill = "Météo", shape = "Météo")

D <- fviz_pca_var(acp, 
             col.var = "cos2", 
             title = "Cercle de corrélation et qualité de représentation dans le plan 1-2", 
             gradient.cols=c("red", "gold", "forestgreen"))

(D+B)/(C+A) 

3.1.1.2 ACP - Classes

Inventaire_Classes_acp <- Inventaire_Classes %>% 
  column_to_rownames(var="Site_gestion_date")
NumVar <- sapply(Inventaire_Classes_acp, is.numeric)
df <- Inventaire_Classes_acp[,NumVar] %>% 
  select(-S_class, -Ab_class)
n <- nrow(df) 
p <- ncol(df)
gestion_2 <- as.factor(Inventaire_Classes_acp$Gestion_2)
gestion_5 <- as.factor(Inventaire_Classes_acp$Gestion_moment_5)
periode <- as.factor(Inventaire_Classes_acp$Periode)
activite <- as.factor(Inventaire_Classes_acp$Activite)
meteo <- as.factor(Inventaire_Classes_acp$Meteo)
site <- as.factor(Inventaire_Classes_acp$Site)
quartier <- as.factor(Inventaire_Classes_acp$Quartier)



acp <- dudi.pca(df, scannf = F, nf = p)
fviz_pca_biplot(acp)

screeplot(acp, main = "Valeurs propres")

fviz_pca_var(acp, 
             col.var = "cos2", 
             title = "Cercle de corrélation et qualité de représentation dans le plan 1-2", 
             gradient.cols=c("red", "gold", "forestgreen")) 

fviz_pca_var(acp, 
             col.var = "cos2", axes = c(2,3),
             title = "Cercle de corrélation et qualité de représentation dans le plan 2-3", 
             gradient.cols=c("red", "gold", "forestgreen")) 

fviz_pca_ind(acp, repel = T,
             labelsize = 2, 
             col.ind = "cos2", 
             gradient.cols=c("red", "gold", "forestgreen"),
             title = "Qualité de représentation des individus dans le plan 1-2")

fviz_pca_ind(acp, axes = c(2,3), 
             labelsize = 0, 
             col.ind = "cos2", 
             gradient.cols=c("red", "gold", "forestgreen"),
             title = "Qualité de représentation des individus dans le plan 2-3")

fviz_pca_ind(acp, 
             labelsize = 0, 
             col.ind = gestion_2, 
             addEllipses = T,
             title = "Position des individus dans le plan 1-2 selon la variable gestion_2") +
    aes(color = gestion_2, shape = gestion_2, fill = gestion_2) + 
    scale_shape_manual(values = c("Fauche" = 16,
                                  "Tonte" = 5)) +
    scale_color_manual(values = c("Fauche" = "#aa1e0f",
                                "Tonte" = "#12661f")) +
   scale_fill_manual(values = c("Fauche" = "#aa1e0f",
                                "Tonte" = "#12661f")) 

fviz_pca_ind(acp, 
             labelsize = 0, 
             col.ind = gestion_5, 
             addEllipses = T,
             title = "Position des individus dans le plan 1-2 selon la variable gestion_5") +
    aes(color = gestion_5, shape = gestion_5, fill = gestion_5) + 
  scale_color_manual(values = c("Graminées" = "#fbcb09",
                                  "Fleuri" = "#ff7207",
                                  "Semé" = "#de1e21",
                                  "Tonte récente" = "#6abe1d",
                                  "Tonte tardive" = "#2b790c")) +
  scale_fill_manual(values = c("Graminées" = "#fbcb09",
                                  "Fleuri" = "#ff7207",
                                  "Semé" = "#de1e21",
                                  "Tonte récente" = "#6abe1d",
                                  "Tonte tardive" = "#2b790c")) +
  scale_shape_manual(values = c("Graminées" = 16,
                                  "Fleuri" = 17,
                                  "Semé" = 15,
                                  "Tonte récente" = 5,
                                  "Tonte tardive" = 6)) 

fviz_pca_ind(acp, 
             labelsize = 0, 
             col.ind = periode, 
             addEllipses = T,
             title = "Position des individus dans le plan 1-2 selon la variable periode") +
  aes(color = periode, shape = periode, fill = periode) +
      scale_color_manual(values = c(Juin = "#74a9cf",
                                 `Mi-juillet` = "#2b8cbe",
                                 `Fin juillet` = "#045a8d")) +
  scale_fill_manual(values = c(Juin = "#74a9cf",
                                 `Mi-juillet` = "#2b8cbe",
                                 `Fin juillet` = "#045a8d"))

fviz_pca_ind(acp, col.var = "var",
             labelsize = 0, 
             col.ind = activite, 
             addEllipses = T,
             title = "Position des individus dans le plan 1-2 selon la variable activite") + 
  aes(color = activite, shape = activite, fill = activite) +
    scale_color_manual(values = c("Forte" = "#3f007d",
                                "Moyenne" = "#6a51a3",
                                "Nulle" = "#9e9ac8")) +
    scale_fill_manual(values = c("Forte" = "#3f007d",
                                "Moyenne" = "#6a51a3",
                                "Nulle" = "#9e9ac8")) 

fviz_pca_ind(acp, 
             labelsize = 0, 
             col.ind = meteo, 
             addEllipses = T,
             title = "Position des individus dans le plan 1-2 selon la variable meteo") +
  aes(color = meteo, shape = meteo, fill = meteo) +
    scale_color_manual(values = c("Nuageux" = "#7f908c",
                                "Alternances" = "#79ccbd",
                                "Soleil" = "#fbcb09")) +
    scale_fill_manual(values = c("Nuageux" = "#7f908c",
                                "Alternances" = "#79ccbd",
                                "Soleil" = "#fbcb09")) 

fviz_pca_ind(acp, 
             labelsize = 0, 
             col.ind = quartier, 
             addEllipses = T,
             title = "Position des individus dans le plan 1-2 selon la variable quartier") 

summary(acp)
## Class: pca dudi
## Call: dudi.pca(df = df, scannf = F, nf = p)
## 
## Total inertia: 9
## 
## Eigenvalues:
##     Ax1     Ax2     Ax3     Ax4     Ax5 
##  2.6816  1.2850  1.2256  0.9067  0.8485 
## 
## Projected inertia (%):
##     Ax1     Ax2     Ax3     Ax4     Ax5 
##  29.796  14.278  13.618  10.075   9.428 
## 
## Cumulative projected inertia (%):
##     Ax1   Ax1:2   Ax1:3   Ax1:4   Ax1:5 
##   29.80   44.07   57.69   67.77   77.19 
## 
## (Only 5 dimensions (out of 9) are shown)
A <- fviz_pca_ind(acp, 
             labelsize = 0, 
             col.ind = gestion_2, 
             addEllipses = T,
             title = "Position des parcelles dans le plan 1-2 selon la variable gestion_2") +
    aes(color = gestion_2, shape = gestion_2, fill = gestion_2) + 
    scale_shape_manual(values = c("Fauche" = 16,
                                  "Tonte" = 5)) +
    scale_color_manual(values = c("Fauche" = "#aa1e0f",
                                "Tonte" = "#12661f")) +
   scale_fill_manual(values = c("Fauche" = "#aa1e0f",
                                "Tonte" = "#12661f")) +
  labs(color = "Type de gestion", fill = "Type de gestion", shape = "Type de gestion")
 

B <- fviz_pca_ind(acp, 
             labelsize = 0, 
             col.ind = gestion_5, 
             addEllipses = T,
             title = "Position des parcelles dans le plan 1-2 selon la variable gestion_5") +
    aes(color = gestion_5, shape = gestion_5, fill = gestion_5)+ 
  scale_color_manual(values = c("Graminées" = "#fbcb09",
                                  "Fleuri" = "#ff7207",
                                  "Semé" = "#de1e21",
                                  "Tonte récente" = "#6abe1d",
                                  "Tonte tardive" = "#2b790c")) +
  scale_fill_manual(values = c("Graminées" = "#fbcb09",
                                  "Fleuri" = "#ff7207",
                                  "Semé" = "#de1e21",
                                  "Tonte récente" = "#6abe1d",
                                  "Tonte tardive" = "#2b790c")) +
  scale_shape_manual(values = c("Graminées" = 16,
                                  "Fleuri" = 17,
                                  "Semé" = 15,
                                  "Tonte récente" = 5,
                                  "Tonte tardive" = 6)) +
  labs(color = "Type de gestion", fill = "Type de gestion", shape = "Type de gestion")



C <- fviz_pca_ind(acp, 
             labelsize = 0, 
             col.ind = periode, 
             addEllipses = T,
             title = "Position des parcelles dans le plan 1-2 selon la variable periode") +
  aes(color = periode, shape = periode, fill = periode) +
      scale_color_manual(values = c(Juin = "#74a9cf",
                                 `Mi-juillet` = "#2b8cbe",
                                 `Fin juillet` = "#045a8d")) +
  scale_fill_manual(values = c(Juin = "#74a9cf",
                                 `Mi-juillet` = "#2b8cbe",
                                 `Fin juillet` = "#045a8d")) +
  labs(color = "Période", fill = "Période", shape = "Période")

D <- fviz_pca_var(acp, 
             col.var = "cos2", 
             title = "Cercle de corrélation et qualité de représentation dans le plan 1-2", 
             gradient.cols=c("red", "gold", "forestgreen"))


(D+B)/(C+A) 

A <- fviz_pca_ind(acp, 
             labelsize = 0, 
             col.ind = quartier, 
             addEllipses = T,
             palette = terrain.colors(10),
             title = "Position des parcelles dans le plan 1-2 selon la variable quartier")  +
  labs(color = "Quartier", fill = "Quartier", shape = "Quartier")

B <- fviz_pca_ind(acp,
             labelsize = 0, 
             col.ind = activite, 
             addEllipses = T,
             title = "Position des parcelles dans le plan 1-2 selon la variable activite") + 
  aes(color = activite, shape = activite, fill = activite) +
    scale_color_manual(values = c("Forte" = "#3f007d",
                                "Moyenne" = "#6a51a3",
                                "Nulle" = "#9e9ac8")) +
    scale_fill_manual(values = c("Forte" = "#3f007d",
                                "Moyenne" = "#6a51a3",
                                "Nulle" = "#9e9ac8"))  +
  labs(color = "Activité", fill = "Activité", shape = "Activité")

C <- fviz_pca_ind(acp, 
             labelsize = 0, 
             col.ind = meteo, 
             addEllipses = T,
             title = "Position des parcelles dans le plan 1-2 selon la variable meteo") +
  aes(color = meteo, shape = meteo, fill = meteo) +
    scale_color_manual(values = c("Nuageux" = "#7f908c",
                                "Alternances" = "#79ccbd",
                                "Soleil" = "#fbcb09")) +
    scale_fill_manual(values = c("Nuageux" = "#7f908c",
                                "Alternances" = "#79ccbd",
                                "Soleil" = "#fbcb09"))  +
  labs(color = "Météo", fill = "Météo", shape = "Météo")

D <- fviz_pca_var(acp, 
             col.var = "cos2", 
             title = "Cercle de corrélation et qualité de représentation dans le plan 1-2", 
             gradient.cols=c("red", "gold", "forestgreen"))

(D+B)/(C+A) 

3.1.1.3 ACP - Fin juillet

AllFinJuillet_acp<- AllFinJuillet[,c(4,19:68)] 
AllFinJuillet_acp <- AllFinJuillet_acp %>% 
  column_to_rownames(var="Parcelle")

NumVar <- sapply(AllFinJuillet_acp, is.numeric)
df <- AllFinJuillet_acp[,NumVar]
n <- nrow(df) 
p <- ncol(df)

gestion_2 <- as.factor(AllFinJuillet$Gestion_2)
gestion_5 <- as.factor(AllFinJuillet$Gestion_moment_5)
activite <- as.factor(AllFinJuillet$Activite)
meteo <- as.factor(AllFinJuillet$Meteo)
site <- as.factor(AllFinJuillet$Site)
quartier <- as.factor(AllFinJuillet$Quartier)

acp <- dudi.pca(df, scannf = F, nf = p)
fviz_pca_biplot(acp)

screeplot(acp, main = "Valeurs propres")

fviz_pca_var(acp, 
             col.var = "cos2", 
             title = "Cercle de corrélation et qualité de représentation dans le plan 1-2", 
             gradient.cols=c("red", "gold", "forestgreen")) 

fviz_pca_var(acp, 
             col.var = "cos2", axes = c(2,3),
             title = "Cercle de corrélation et qualité de représentation dans le plan 2-3", 
             gradient.cols=c("red", "gold", "forestgreen")) 

fviz_pca_ind(acp, repel = T,
             labelsize = 2, 
             col.ind = "cos2", 
             gradient.cols=c("red", "gold", "forestgreen"),
             title = "Qualité de représentation des individus dans le plan 1-2")

fviz_pca_ind(acp, axes = c(2,3), 
             labelsize = 0, 
             col.ind = "cos2", 
             gradient.cols=c("red", "gold", "forestgreen"),
             title = "Qualité de représentation des individus dans le plan 2-3")

fviz_pca_ind(acp, 
             labelsize = 0, 
             col.ind = gestion_2, 
             addEllipses = T,
             title = "Position des individus dans le plan 1-2 selon la variable gestion_2") +
      aes(color = gestion_2, shape = gestion_2, fill = gestion_2) + 
    scale_shape_manual(values = c("Fauche" = 16,
                                  "Tonte" = 5)) +
    scale_color_manual(values = c("Fauche" = "#aa1e0f",
                                "Tonte" = "#12661f")) +
   scale_fill_manual(values = c("Fauche" = "#aa1e0f",
                                "Tonte" = "#12661f")) 

fviz_pca_ind(acp, 
             labelsize = 0, 
             col.ind = gestion_5, 
             addEllipses = T,
             title = "Position des individus dans le plan 1-2 selon la variable gestion_5") +
    aes(color = gestion_5, shape = gestion_5, fill = gestion_5) + 
  scale_color_manual(values = c("Graminées" = "#fbcb09",
                                  "Fleuri" = "#ff7207",
                                  "Semé" = "#de1e21",
                                  "Tonte récente" = "#6abe1d",
                                  "Tonte tardive" = "#2b790c")) +
  scale_fill_manual(values = c("Graminées" = "#fbcb09",
                                  "Fleuri" = "#ff7207",
                                  "Semé" = "#de1e21",
                                  "Tonte récente" = "#6abe1d",
                                  "Tonte tardive" = "#2b790c")) +
  scale_shape_manual(values = c("Graminées" = 16,
                                  "Fleuri" = 17,
                                  "Semé" = 15,
                                  "Tonte récente" = 5,
                                  "Tonte tardive" = 6)) 

fviz_pca_ind(acp, col.var = "var",
             labelsize = 0, 
             col.ind = activite, 
             addEllipses = T,
             title = "Position des parcelles dans le plan 1-2 selon la variable activite") + 
  aes(color = activite, shape = activite, fill = activite) +
    scale_color_manual(values = c("Forte" = "#3f007d",
                                "Moyenne" = "#6a51a3",
                                "Nulle" = "#9e9ac8")) +
    scale_fill_manual(values = c("Forte" = "#3f007d",
                                "Moyenne" = "#6a51a3",
                                "Nulle" = "#9e9ac8")) 

fviz_pca_ind(acp, 
             labelsize = 0, 
             col.ind = meteo, 
             addEllipses = T,
             title = "Position des parcelles dans le plan 1-2 selon la variable meteo") +
  aes(color = meteo, shape = meteo, fill = meteo) +
    scale_color_manual(values = c("Nuageux" = "#7f908c",
                                "Alternances" = "#79ccbd",
                                "Soleil" = "#fbcb09")) +
    scale_fill_manual(values = c("Nuageux" = "#7f908c",
                                "Alternances" = "#79ccbd",
                                "Soleil" = "#fbcb09")) 

fviz_pca_ind(acp, 
             labelsize = 0, 
             col.ind = quartier, 
             addEllipses = T,
             title = "Position des parcelles dans le plan 1-2 selon la variable quartier") 

summary(acp)
## Class: pca dudi
## Call: dudi.pca(df = df, scannf = F, nf = p)
## 
## Total inertia: 43
## 
## Eigenvalues:
##     Ax1     Ax2     Ax3     Ax4     Ax5 
##   8.348   4.048   3.627   3.039   2.787 
## 
## Projected inertia (%):
##     Ax1     Ax2     Ax3     Ax4     Ax5 
##  19.413   9.415   8.436   7.067   6.481 
## 
## Cumulative projected inertia (%):
##     Ax1   Ax1:2   Ax1:3   Ax1:4   Ax1:5 
##   19.41   28.83   37.26   44.33   50.81 
## 
## (Only 5 dimensions (out of 30) are shown)
A <- fviz_pca_ind(acp, 
             labelsize = 0, 
             col.ind = gestion_2, 
             addEllipses = T,
             title = "Position des parcelles dans le plan 1-2 selon la variable gestion_2") +
    aes(color = gestion_2, shape = gestion_2, fill = gestion_2) + 
    scale_shape_manual(values = c("Fauche" = 16,
                                  "Tonte" = 5)) +
    scale_color_manual(values = c("Fauche" = "#aa1e0f",
                                "Tonte" = "#12661f")) +
   scale_fill_manual(values = c("Fauche" = "#aa1e0f",
                                "Tonte" = "#12661f"))  +
  labs(color = "Type de gestion", fill = "Type de gestion", shape = "Type de gestion")

B <- fviz_pca_ind(acp, 
             labelsize = 0, 
             col.ind = gestion_5, 
             addEllipses = T,
             title = "Position des parcelles dans le plan 1-2 selon la variable gestion_5") +
    aes(color = gestion_5, shape = gestion_5, fill = gestion_5)+ 
  scale_color_manual(values = c("Graminées" = "#fbcb09",
                                  "Fleuri" = "#ff7207",
                                  "Semé" = "#de1e21",
                                  "Tonte récente" = "#6abe1d",
                                  "Tonte tardive" = "#2b790c")) +
  scale_fill_manual(values = c("Graminées" = "#fbcb09",
                                  "Fleuri" = "#ff7207",
                                  "Semé" = "#de1e21",
                                  "Tonte récente" = "#6abe1d",
                                  "Tonte tardive" = "#2b790c")) +
  scale_shape_manual(values = c("Graminées" = 16,
                                  "Fleuri" = 17,
                                  "Semé" = 15,
                                  "Tonte récente" = 5,
                                  "Tonte tardive" = 6)) +
  labs(color = "Type de gestion", fill = "Type de gestion", shape = "Type de gestion")

C <- fviz_pca_ind(acp, 
             labelsize = 0, 
             col.ind = meteo, 
             addEllipses = T,
             title = "Position des parcelles dans le plan 1-2 selon la variable meteo") +
  aes(color = meteo, shape = meteo, fill = meteo) +
    scale_color_manual(values = c("Nuageux" = "#7f908c",
                                "Alternances" = "#79ccbd",
                                "Soleil" = "#fbcb09")) +
    scale_fill_manual(values = c("Nuageux" = "#7f908c",
                                "Alternances" = "#79ccbd",
                                "Soleil" = "#fbcb09"))  +
  labs(color = "Météo", fill = "Météo", shape = "Météo")

D <- fviz_pca_var(acp, 
             col.var = "cos2", 
             title = "Cercle de corrélation et qualité de représentation dans le plan 1-2", 
             gradient.cols=c("red", "gold", "forestgreen"))


(D+B)/(C+A) 

3.1.2 ACC

3.1.2.1 ACC - Sp plantes

Y <- Esp_Plant
X <- Inv %>% 
  select(!c(Site, Parcelle,Gestion_2, Gestion_4, Gestion_moment_4, Date, Heure_debut, Heure_fin, Quartier, Meteo, Jours, Mixte_isole, Activite, Nombre_quadrats))

#dim(X) ; dim(Y) 
X<-X[rowSums(Y)!=0,]
Y<-Y[rowSums(Y)!=0,]
Y<-Y[,colSums(Y)!=0] 
n <- nrow(Y)
#n == nrow(X) 
p <- ncol(Y)
m <- ncol(X)
gestion_2 <- as.factor(X$Gestion_2)
gestion_5 <- as.factor(X$Gestion_moment_5)

afc_Y <- dudi.coa(Y,  scannf = FALSE, nf = p)
acc <- pcaiv(afc_Y, X,  scannf = FALSE, nf = m)

Q <- viz_coaiv(acc,"co") + 
  scale_x_continuous(limits=c(-1.5, 2))
viz_coaiv(acc,"li")

viz_coaiv(acc, "li", axes = c(2,3)) 

Z <-  viz_coaiv(acc, "ls")  + 
  scale_x_continuous(limits=c(-1.1, 1.9))
viz_coaiv(acc, "match")

viz_coaiv(acc, "fa") 

E <- viz_coaiv(acc, "cor")  + 
  scale_x_continuous(limits=c(-1.5, 1.5))
viz_coaiv(acc, "cor", axes=c(1,3)) 

viz_coaiv(acc, "li", axes = c(1,3))

R <- viz_coaiv(acc, "as") 
viz_coaiv(acc, "as", axes=c(2,3)) 

Z = Z + aes(color = gestion_5) + labs(title = "Position des parcelles", color = "Type de gestion", fill = "Type de gestion", shape = "Type de gestion") +
      scale_color_manual(values = c("Graminées" = "#fbcb09",
                                  "Fleuri" = "#ff7207",
                                  "Semé" = "#de1e21",
                                  "Tonte récente" = "#6abe1d",
                                  "Tonte tardive" = "#2b790c")) + 
  theme (legend.position = "bottom",
         text = element_text(size=12))
Q = Q + labs(title = "Position des espèces de plantes") +
   theme (legend.position = "bottom",
         text = element_text(size=12))
E= E + labs(title = "Variables explicatives") +
   theme (legend.position = "bottom",
         text = element_text(size=12))
R= R + labs(title = "Participations des axes à la dimention 1-2")

(Q + E) / (Z + R)

(Q + E) / (Z)

3.1.2.2 ACC - Sp poll

Y <- Esp_Poll
X <- Inv %>% 
  select(!c(Site, Parcelle,Gestion_2, Gestion_4, Gestion_moment_4, Date, Heure_debut, Heure_fin, Quartier, Meteo, Jours, Mixte_isole, Activite, Nombre_quadrats))

#dim(X) ; dim(Y) 
X<-X[rowSums(Y)!=0,]
Y<-Y[rowSums(Y)!=0,]
Y<-Y[,colSums(Y)!=0] 
n <- nrow(Y)
#n == nrow(X) 
p <- ncol(Y)
m <- ncol(X)
gestion_2 <- as.factor(X$Gestion_2)
gestion_5 <- as.factor(X$Gestion_moment_5)

afc_Y <- dudi.coa(Y,  scannf = FALSE, nf = p)
acc <- pcaiv(afc_Y, X,  scannf = FALSE, nf = m)

Q <- viz_coaiv(acc,"co") 
viz_coaiv(acc,"li")

viz_coaiv(acc, "li", axes = c(2,3))

Z <-  viz_coaiv(acc, "ls") 
viz_coaiv(acc, "match")

viz_coaiv(acc, "fa") 

E <- viz_coaiv(acc, "cor") 
viz_coaiv(acc, "cor", axes=c(1,3)) 

viz_coaiv(acc, "li", axes = c(1,3))

R <- viz_coaiv(acc, "as") 
viz_coaiv(acc, "as", axes=c(2,3)) 

Z = Z + aes(color = gestion_5) + labs(title = "Position des parcelles", color = "Type de gestion", fill = "Type de gestion", shape = "Type de gestion") + 
  scale_color_manual(values = c("Graminées" = "#fbcb09",
                                  "Fleuri" = "#ff7207",
                                  "Semé" = "#de1e21",
                                  "Tonte récente" = "#6abe1d",
                                  "Tonte tardive" = "#2b790c")) 
Q = Q + labs(title = "Position des espèces de pollinisateurs")
E= E + labs(title = "Variables explicatives")
R= R + labs(title = "Participations des axes à la dimention 1-2")

(Q + E) / (Z + R)

3.1.2.3 ACC - Classes poll

Inv_Classes_acp <- Inv_Classes %>% 
  column_to_rownames(var = "Site_gestion_date")
Y <- Inv_Classes_acp
X <- Inv %>% 
  select(!c(Site, Parcelle,Gestion_2, Gestion_4, Gestion_moment_4, Date, Heure_debut, Heure_fin, Quartier, Meteo, Jours, Mixte_isole, Activite, Nombre_quadrats))

#dim(X) ; dim(Y) 
X<-X[rowSums(Y)!=0,]
Y<-Y[rowSums(Y)!=0,]
Y<-Y[,colSums(Y)!=0] 
n <- nrow(Y)
#n == nrow(X) 
p <- ncol(Y)
m <- ncol(X)
gestion_2 <- as.factor(X$Gestion_2)
gestion_5 <- as.factor(X$Gestion_moment_5)

afc_Y <- dudi.coa(Y,  scannf = FALSE, nf = p)
acc <- pcaiv(afc_Y, X,  scannf = FALSE, nf = m)

Q <- viz_coaiv(acc,"co") 
viz_coaiv(acc,"li")

viz_coaiv(acc, "li", axes = c(2,3))

Z <-  viz_coaiv(acc, "ls") 
viz_coaiv(acc, "match")

viz_coaiv(acc, "fa") 

E <- viz_coaiv(acc, "cor") 
viz_coaiv(acc, "cor", axes=c(1,3)) 

viz_coaiv(acc, "li", axes = c(1,3))

R <- viz_coaiv(acc, "as") 
viz_coaiv(acc, "as", axes=c(2,3)) 

Z = Z + aes(color = gestion_5) + labs(title = "Position des parcelles", color = "Type de gestion", fill = "Type de gestion", shape = "Type de gestion") +
      scale_color_manual(values = c("Graminées" = "#fbcb09",
                                  "Fleuri" = "#ff7207",
                                  "Semé" = "#de1e21",
                                  "Tonte récente" = "#6abe1d",
                                  "Tonte tardive" = "#2b790c")) 
Q = Q + labs(title = "Position des catégories de pollinisateurs")
E= E + labs(title = "Variables explicatives")
R= R + labs(title = "Participations des axes à la dimention 1-2")

(Q + E) / (Z + R)

3.1.2.4 ACC - Fin juillet

fin_juil_espPl<- FinJuil_AllPl[,c(1,33:82)] %>% 
  column_to_rownames(var = "Site_gestion_date") 

Y <- fin_juil_espPl
X <- Inv %>% 
  filter(Periode=="Fin juillet") %>% 
  select(!c(Site, Parcelle, Gestion_2, Gestion_4, Gestion_moment_4, Date, Heure_debut, Heure_fin, Jours, Periode, Quartier, Meteo,Jours, Mixte_isole, Activite, Nombre_quadrats))

# dim(X) ; dim(Y) 
X<-X[rowSums(Y)!=0,]
Y<-Y[rowSums(Y)!=0,]
Y<-Y[,colSums(Y)!=0] 
n <- nrow(Y)
# n == nrow(X) 
p <- ncol(Y)
m <- ncol(X)
gestion_2 <- as.factor(X$Gestion_2)
gestion_5 <- as.factor(X$Gestion_moment_5)

afc_Y <- dudi.coa(Y,  scannf = FALSE, nf = p)
acc <- pcaiv(afc_Y, X,  scannf = FALSE, nf = m)

Q <- viz_coaiv(acc,"co") 
viz_coaiv(acc,"li")

viz_coaiv(acc, "li", axes = c(2,3))

Z <-  viz_coaiv(acc, "ls") 
viz_coaiv(acc, "match")

viz_coaiv(acc, "fa") 

E <- viz_coaiv(acc, "cor") 
viz_coaiv(acc, "cor", axes=c(1,3)) 

viz_coaiv(acc, "li", axes = c(1,3))

R <- viz_coaiv(acc, "as") 
viz_coaiv(acc, "as", axes=c(2,3)) 

Z = Z + aes(color = gestion_5) + labs(title = "Position des parcelles", color = "Type de gestion", fill = "Type de gestion", shape = "Type de gestion") +
      scale_color_manual(values = c("Graminées" = "#fbcb09",
                                  "Fleuri" = "#ff7207",
                                  "Semé" = "#de1e21",
                                  "Tonte récente" = "#6abe1d",
                                  "Tonte tardive" = "#2b790c")) 
Q = Q + labs(title = "Position des espèces de plantes")
E= E + labs(title = "Variables explicatives")
R= R + labs(title = "Participations des axes à la dimention 1-2")

(Q + E) / (Z + R)

3.2 Modèles linéaires

3.2.1 LMM 1. G2 - Sélection et simplification des modèles

3.2.1.1 S Plant

LM1_S_Pl <- lmer(S_Plant ~ Area_gis_m_sq + Temperature + Periode * Gestion_2 + (1|Parcelle), data = Inv)
# check_model(LM1_S_Pl)
# shapiro.test(residuals(LM1_S_Pl))

LM1_S_Pl <- lmer(sqrt(S_Plant) ~ Area_gis_m_sq + Temperature + Periode * Gestion_2 + (1|Parcelle), data = Inv)
# check_model(LM1_S_Pl)
# shapiro.test(residuals(LM1_S_Pl))

step(LM1_S_Pl, direction = "backward") # sqrt(S_Plant) ~ Gestion_2 + (1 | Parcelle)
check_model(LM1_S_Pl)

Anova(LM1_S_Pl)
## Analysis of Deviance Table (Type II Wald chisquare tests)
## 
## Response: sqrt(S_Plant)
##                    Chisq Df Pr(>Chisq)   
## Area_gis_m_sq     0.6372  1   0.424721   
## Temperature       2.7291  1   0.098534 . 
## Periode           4.9930  2   0.082372 . 
## Gestion_2         6.9948  1   0.008175 **
## Periode:Gestion_2 1.4705  2   0.479388   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
summary(LM1_S_Pl)
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: sqrt(S_Plant) ~ Area_gis_m_sq + Temperature + Periode * Gestion_2 +  
##     (1 | Parcelle)
##    Data: Inv
## 
## REML criterion at convergence: 263.7
## 
## Scaled residuals: 
##      Min       1Q   Median       3Q      Max 
## -2.69122 -0.41288  0.01216  0.50325  2.37157 
## 
## Random effects:
##  Groups   Name        Variance Std.Dev.
##  Parcelle (Intercept) 0.3987   0.6314  
##  Residual             0.1617   0.4021  
## Number of obs: 134, groups:  Parcelle, 46
## 
## Fixed effects:
##                                     Estimate Std. Error         df t value
## (Intercept)                        2.995e+00  4.097e-01  1.202e+02   7.309
## Area_gis_m_sq                     -3.186e-05  3.991e-05  4.201e+01  -0.798
## Temperature                       -2.617e-02  1.584e-02  1.021e+02  -1.652
## PeriodeMi-juillet                 -1.233e-01  1.242e-01  8.178e+01  -0.992
## PeriodeFin juillet                -2.525e-01  1.347e-01  8.358e+01  -1.875
## Gestion_2Tonte                    -5.624e-01  2.276e-01  6.078e+01  -2.471
## PeriodeMi-juillet:Gestion_2Tonte  -6.997e-02  1.687e-01  8.183e+01  -0.415
## PeriodeFin juillet:Gestion_2Tonte  1.426e-01  1.786e-01  8.353e+01   0.798
##                                   Pr(>|t|)    
## (Intercept)                       3.25e-11 ***
## Area_gis_m_sq                       0.4292    
## Temperature                         0.1016    
## PeriodeMi-juillet                   0.3240    
## PeriodeFin juillet                  0.0643 .  
## Gestion_2Tonte                      0.0163 *  
## PeriodeMi-juillet:Gestion_2Tonte    0.6794    
## PeriodeFin juillet:Gestion_2Tonte   0.4270    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr) Ar_g__ Tmprtr PrdM-j PrdFnj Gst_2T PM-:G_
## Are_gs_m_sq -0.206                                          
## Temperature -0.910  0.103                                   
## PeridM-jllt -0.107 -0.005 -0.049                            
## PeridFnjllt -0.231  0.018  0.100  0.455                     
## Gestin_2Tnt -0.308 -0.216  0.052  0.270  0.255              
## PrdM-j:G_2T  0.175 -0.007 -0.069 -0.731 -0.346 -0.372       
## PrdFjl:G_2T  0.268 -0.024 -0.178 -0.338 -0.764 -0.356  0.482
## fit warnings:
## Some predictor variables are on very different scales: consider rescaling
# LM1_S_Pl
eLM1_S_Pl_P<-emmeans(LM1_S_Pl,"Periode")
mcLM1_S_Pl_P<-cld(eLM1_S_Pl_P,ajust="tukey")
mcLM1_S_Pl_P$.group<-as.numeric(mcLM1_S_Pl_P$.group)
mcLM1_S_Pl_P$group[mcLM1_S_Pl_P$.group == 1] <- "a"
mcLM1_S_Pl_P$group[mcLM1_S_Pl_P$.group == 2] <- "b"
mcLM1_S_Pl_P
##  Periode     emmean    SE   df lower.CL upper.CL .group group
##  Fin juillet   1.87 0.114 68.5     1.64     2.10      1 a    
##  Mi-juillet    1.89 0.111 63.5     1.67     2.11      1 a    
##  Juin          2.05 0.111 63.5     1.83     2.27      1 a    
## 
## Results are averaged over the levels of: Gestion_2 
## Degrees-of-freedom method: kenward-roger 
## Results are given on the sqrt (not the response) scale. 
## Confidence level used: 0.95 
## Note: contrasts are still on the sqrt scale 
## P value adjustment: tukey method for comparing a family of 3 estimates 
## significance level used: alpha = 0.05 
## NOTE: If two or more means share the same grouping symbol,
##       then we cannot show them to be different.
##       But we also did not show them to be the same.
eLM1_S_Pl_G2<-emmeans(LM1_S_Pl,"Gestion_2")
mcLM1_S_Pl_G2<-cld(eLM1_S_Pl_G2,ajust="tukey")
mcLM1_S_Pl_G2$.group<-as.numeric(mcLM1_S_Pl_G2$.group)
mcLM1_S_Pl_G2$group[mcLM1_S_Pl_G2$.group == 1] <- "a"
mcLM1_S_Pl_G2$group[mcLM1_S_Pl_G2$.group == 2] <- "b"
mcLM1_S_Pl_G2
##  Gestion_2 emmean    SE   df lower.CL upper.CL .group group
##  Tonte       1.67 0.137 42.4     1.39     1.94      1 a    
##  Fauche      2.21 0.150 43.5     1.90     2.51      2 b    
## 
## Results are averaged over the levels of: Periode 
## Degrees-of-freedom method: kenward-roger 
## Results are given on the sqrt (not the response) scale. 
## Confidence level used: 0.95 
## Note: contrasts are still on the sqrt scale 
## significance level used: alpha = 0.05 
## NOTE: If two or more means share the same grouping symbol,
##       then we cannot show them to be different.
##       But we also did not show them to be the same.

3.2.1.2 Ab Plant

LM1_Ab_Pl <- lmer(Ab_Plant ~ Area_gis_m_sq + Temperature + Periode * Gestion_2 + (1|Parcelle), data = Inv)
# check_model(LM1_Ab_Pl)
# shapiro.test(residuals(LM1_Ab_Pl))

LM1_Ab_Pl <- lmer(sqrt(Ab_Plant) ~ Area_gis_m_sq + Temperature + Periode * Gestion_2 + (1|Parcelle), data = Inv)
# check_model(LM1_Ab_Pl)
# shapiro.test(residuals(LM1_Ab_Pl))

step(LM1_Ab_Pl, direction = "backward") # sqrt(Ab_Plant) ~ Temperature + Periode + (1 | Parcelle)
check_model(LM1_Ab_Pl)

Anova(LM1_Ab_Pl)
## Analysis of Deviance Table (Type II Wald chisquare tests)
## 
## Response: sqrt(Ab_Plant)
##                     Chisq Df Pr(>Chisq)    
## Area_gis_m_sq      0.0043  1    0.94759    
## Temperature        4.7783  1    0.02882 *  
## Periode           31.3188  2  1.582e-07 ***
## Gestion_2          0.6270  1    0.42847    
## Periode:Gestion_2  3.1873  2    0.20319    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
# summary(LM1_Ab_Pl)
coef(LM1_Ab_Pl)
##                       (Intercept)                     Area_gis_m_sq 
##                      1.508921e+01                      1.430211e-05 
##                       Temperature                 PeriodeMi-juillet 
##                     -2.382167e-01                     -1.492381e+00 
##                PeriodeFin juillet                    Gestion_2Tonte 
##                     -2.734592e+00                      1.369802e-01 
##  PeriodeMi-juillet:Gestion_2Tonte PeriodeFin juillet:Gestion_2Tonte 
##                     -2.149672e+00                     -9.127128e-01
# LM1_Ab_Pl
eLM1_Ab_Pl_P<-emmeans(LM1_Ab_Pl,"Periode")
mcLM1_Ab_Pl_P<-cld(eLM1_Ab_Pl_P,ajust="tukey")
mcLM1_Ab_Pl_P$.group<-as.numeric(mcLM1_Ab_Pl_P$.group)
mcLM1_Ab_Pl_P$group[mcLM1_Ab_Pl_P$.group == 1] <- "b"
mcLM1_Ab_Pl_P$group[mcLM1_Ab_Pl_P$.group == 2] <- "a"
mcLM1_Ab_Pl_P
##  Periode     emmean    SE   df lower.CL upper.CL .group group
##  Fin juillet   6.50 0.668 84.8     5.17     7.83      1 b    
##  Mi-juillet    7.12 0.645 77.9     5.84     8.41      1 b    
##  Juin          9.69 0.645 77.9     8.41    10.97      2 a    
## 
## Results are averaged over the levels of: Gestion_2 
## Degrees-of-freedom method: kenward-roger 
## Results are given on the sqrt (not the response) scale. 
## Confidence level used: 0.95 
## Note: contrasts are still on the sqrt scale 
## P value adjustment: tukey method for comparing a family of 3 estimates 
## significance level used: alpha = 0.05 
## NOTE: If two or more means share the same grouping symbol,
##       then we cannot show them to be different.
##       But we also did not show them to be the same.
eLM1_Ab_Pl_G2<-emmeans(LM1_Ab_Pl,"Gestion_2")
mcLM1_Ab_Pl_G2<-cld(eLM1_Ab_Pl_G2,ajust="tukey")
mcLM1_Ab_Pl_G2$.group<-as.numeric(mcLM1_Ab_Pl_G2$.group)
mcLM1_Ab_Pl_G2$group[mcLM1_Ab_Pl_G2$.group == 1] <- "a"
mcLM1_Ab_Pl_G2$group[mcLM1_Ab_Pl_G2$.group == 2] <- "b"
mcLM1_Ab_Pl_G2
##  Gestion_2 emmean    SE   df lower.CL upper.CL .group group
##  Tonte       7.33 0.742 42.0     5.83     8.82      1 a    
##  Fauche      8.21 0.821 43.7     6.56     9.87      1 a    
## 
## Results are averaged over the levels of: Periode 
## Degrees-of-freedom method: kenward-roger 
## Results are given on the sqrt (not the response) scale. 
## Confidence level used: 0.95 
## Note: contrasts are still on the sqrt scale 
## significance level used: alpha = 0.05 
## NOTE: If two or more means share the same grouping symbol,
##       then we cannot show them to be different.
##       But we also did not show them to be the same.

3.2.1.3 S Poll

LM1_S_Po <- lmer(S_Poll ~ Area_gis_m_sq + Temperature + Periode * Gestion_2 + (1|Parcelle), data = Inv)
# check_model(LM1_S_Po)
# shapiro.test(residuals(LM1_S_Po))

LM1_S_Po <- lmer(sqrt(S_Poll) ~ Area_gis_m_sq + Temperature + Periode * Gestion_2 + (1|Parcelle), data = Inv)
# check_model(LM1_S_Po)
# shapiro.test(residuals(LM1_S_Po))

step(LM1_S_Po, direction = "backward") # sqrt(S_Poll) ~ Gestion_2 + (1 | Parcelle)
check_model(LM1_S_Po)

Anova(LM1_S_Po)
## Analysis of Deviance Table (Type II Wald chisquare tests)
## 
## Response: sqrt(S_Poll)
##                     Chisq Df Pr(>Chisq)    
## Area_gis_m_sq      0.3284  1    0.56659    
## Temperature        0.7725  1    0.37945    
## Periode            5.1152  2    0.07749 .  
## Gestion_2         32.0557  1  1.498e-08 ***
## Periode:Gestion_2  0.1999  2    0.90489    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
# summary(LM1_S_Po)
# LM1_S_Po
eLM1_S_Po_P<-emmeans(LM1_S_Po,"Periode")
mcLM1_S_Po_P<-cld(eLM1_S_Po_P,ajust="tukey")
mcLM1_S_Po_P$.group<-as.numeric(mcLM1_S_Po_P$.group)
mcLM1_S_Po_P$group[mcLM1_S_Po_P$.group == 1] <- "a"
mcLM1_S_Po_P$group[mcLM1_S_Po_P$.group == 2] <- "b"
mcLM1_S_Po_P
##  Periode     emmean    SE   df lower.CL upper.CL .group group
##  Fin juillet   2.01 0.142 97.7     1.72     2.29      1 a    
##  Mi-juillet    2.04 0.136 90.6     1.78     2.31      1 a    
##  Juin          2.30 0.136 90.6     2.03     2.57      1 a    
## 
## Results are averaged over the levels of: Gestion_2 
## Degrees-of-freedom method: kenward-roger 
## Results are given on the sqrt (not the response) scale. 
## Confidence level used: 0.95 
## Note: contrasts are still on the sqrt scale 
## P value adjustment: tukey method for comparing a family of 3 estimates 
## significance level used: alpha = 0.05 
## NOTE: If two or more means share the same grouping symbol,
##       then we cannot show them to be different.
##       But we also did not show them to be the same.
eLM1_S_Po_G2<-emmeans(LM1_S_Po,"Gestion_2")
mcLM1_S_Po_G2<-cld(eLM1_S_Po_G2,ajust="tukey")
mcLM1_S_Po_G2$.group<-as.numeric(mcLM1_S_Po_G2$.group)
mcLM1_S_Po_G2$group[mcLM1_S_Po_G2$.group == 1] <- "a"
mcLM1_S_Po_G2$group[mcLM1_S_Po_G2$.group == 2] <- "b"
mcLM1_S_Po_G2
##  Gestion_2 emmean    SE   df lower.CL upper.CL .group group
##  Tonte       1.48 0.147 41.6     1.19     1.78      1 a    
##  Fauche      2.75 0.164 43.9     2.42     3.08      2 b    
## 
## Results are averaged over the levels of: Periode 
## Degrees-of-freedom method: kenward-roger 
## Results are given on the sqrt (not the response) scale. 
## Confidence level used: 0.95 
## Note: contrasts are still on the sqrt scale 
## significance level used: alpha = 0.05 
## NOTE: If two or more means share the same grouping symbol,
##       then we cannot show them to be different.
##       But we also did not show them to be the same.

3.2.1.4 Ab Poll

LM1_Ab_Po <- lmer(Ab_Poll ~ Area_gis_m_sq + Temperature + Periode * Gestion_2 + (1|Parcelle), data = Inv)
# check_model(LM1_Ab_Po)
# shapiro.test(residuals(LM1_Ab_Po))

LM1_Ab_Po <- lmer(sqrt(Ab_Poll) ~ Area_gis_m_sq + Temperature + Periode * Gestion_2 + (1|Parcelle), data = Inv)
# check_model(LM1_Ab_Po)
# shapiro.test(residuals(LM1_Ab_Po))

step(LM1_Ab_Po, direction = "backward") # sqrt(Ab_Poll) ~ Gestion_2 + (1 | Parcelle)
check_model(LM1_Ab_Po)

Anova(LM1_Ab_Po)
## Analysis of Deviance Table (Type II Wald chisquare tests)
## 
## Response: sqrt(Ab_Poll)
##                     Chisq Df Pr(>Chisq)    
## Area_gis_m_sq      0.0360  1     0.8496    
## Temperature        0.0007  1     0.9791    
## Periode            3.3492  2     0.1874    
## Gestion_2         28.7659  1  8.168e-08 ***
## Periode:Gestion_2  2.9264  2     0.2315    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
# summary(LM1_Ab_Po)
# LM1_Ab_Po
eLM1_Ab_Po_P<-emmeans(LM1_Ab_Po,"Periode")
mcLM1_Ab_Po_P<-cld(eLM1_Ab_Po_P,ajust="tukey")
mcLM1_Ab_Po_P$.group<-as.numeric(mcLM1_Ab_Po_P$.group)
mcLM1_Ab_Po_P$group[mcLM1_Ab_Po_P$.group == 1] <- "a"
mcLM1_Ab_Po_P$group[mcLM1_Ab_Po_P$.group == 2] <- "b"
mcLM1_Ab_Po_P
##  Periode     emmean    SE    df lower.CL upper.CL .group group
##  Fin juillet   2.81 0.254 100.8     2.30     3.31      1 a    
##  Mi-juillet    3.18 0.243  93.8     2.69     3.66      1 a    
##  Juin          3.30 0.243  93.9     2.82     3.78      1 a    
## 
## Results are averaged over the levels of: Gestion_2 
## Degrees-of-freedom method: kenward-roger 
## Results are given on the sqrt (not the response) scale. 
## Confidence level used: 0.95 
## Note: contrasts are still on the sqrt scale 
## P value adjustment: tukey method for comparing a family of 3 estimates 
## significance level used: alpha = 0.05 
## NOTE: If two or more means share the same grouping symbol,
##       then we cannot show them to be different.
##       But we also did not show them to be the same.
eLM1_Ab_Po_G2<-emmeans(LM1_Ab_Po,"Gestion_2")
mcLM1_Ab_Po_G2<-cld(eLM1_Ab_Po_G2,ajust="tukey")
mcLM1_Ab_Po_G2$.group<-as.numeric(mcLM1_Ab_Po_G2$.group)
mcLM1_Ab_Po_G2$group[mcLM1_Ab_Po_G2$.group == 1] <- "a"
mcLM1_Ab_Po_G2$group[mcLM1_Ab_Po_G2$.group == 2] <- "b"
mcLM1_Ab_Po_G2
##  Gestion_2 emmean    SE   df lower.CL upper.CL .group group
##  Tonte       2.04 0.259 41.5     1.52     2.57      1 a    
##  Fauche      4.14 0.289 44.0     3.56     4.73      2 b    
## 
## Results are averaged over the levels of: Periode 
## Degrees-of-freedom method: kenward-roger 
## Results are given on the sqrt (not the response) scale. 
## Confidence level used: 0.95 
## Note: contrasts are still on the sqrt scale 
## significance level used: alpha = 0.05 
## NOTE: If two or more means share the same grouping symbol,
##       then we cannot show them to be different.
##       But we also did not show them to be the same.

3.2.2 LMM 2. G5 - Sélection et simplification des modèles

3.2.2.1 S Plant

LM2_S_Pl <- lmer(S_Plant ~ Area_gis_m_sq + Temperature + Periode * Gestion_moment_5 + (1|Parcelle), data = Inv)
# check_model(LM2_S_Pl)
# shapiro.test(residuals(LM2_S_Pl))

LM2_S_Pl <- lmer(sqrt(S_Plant) ~ Area_gis_m_sq + Temperature + Periode * Gestion_moment_5 + (1|Parcelle), data = Inv)
# check_model(LM2_S_Pl)
# shapiro.test(residuals(LM2_S_Pl))

step(LM2_S_Pl, direction = "backward") # sqrt(S_Plant) ~ Periode + Gestion_moment_5 + (1 | Parcelle)
check_model(LM2_S_Pl)

Anova(LM2_S_Pl)
## Analysis of Deviance Table (Type II Wald chisquare tests)
## 
## Response: sqrt(S_Plant)
##                            Chisq Df Pr(>Chisq)    
## Area_gis_m_sq             0.1796  1     0.6717    
## Temperature               1.1648  1     0.2805    
## Periode                   7.6610  2     0.0217 *  
## Gestion_moment_5         74.9761  4  2.016e-15 ***
## Periode:Gestion_moment_5 11.2378  8     0.1886    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
# summary(LM2_S_Pl)
# LM2_S_Pl
eLM2_S_Pl_P<-emmeans(LM2_S_Pl,"Periode")
mcLM2_S_Pl_P<-cld(eLM2_S_Pl_P,ajust="tukey")
mcLM2_S_Pl_P$.group<-as.numeric(mcLM2_S_Pl_P$.group)
mcLM2_S_Pl_P$group[mcLM2_S_Pl_P$.group == 1] <- "a"
mcLM2_S_Pl_P$group[mcLM2_S_Pl_P$.group == 2] <- "b"
mcLM2_S_Pl_P
##  Periode     emmean     SE   df lower.CL upper.CL .group group
##  Fin juillet   1.84 0.1008 82.7     1.64     2.04      1 a    
##  Mi-juillet    1.85 0.0930 67.9     1.67     2.04      1 a    
##  Juin          1.98 0.0939 69.7     1.79     2.17      1 a    
## 
## Results are averaged over the levels of: Gestion_moment_5 
## Degrees-of-freedom method: kenward-roger 
## Results are given on the sqrt (not the response) scale. 
## Confidence level used: 0.95 
## Note: contrasts are still on the sqrt scale 
## P value adjustment: tukey method for comparing a family of 3 estimates 
## significance level used: alpha = 0.05 
## NOTE: If two or more means share the same grouping symbol,
##       then we cannot show them to be different.
##       But we also did not show them to be the same.
CM2_S_Pl_P_G <- Inv %>% 
  filter(Gestion_moment_5 == "Graminées")
LM2_S_Pl_P_G <- lmer(sqrt(S_Plant) ~ Area_gis_m_sq + Temperature + Periode + (1|Parcelle), data = CM2_S_Pl_P_G)
eLM2_S_Pl_P_G<-emmeans(LM2_S_Pl_P_G,"Periode")
mcLM2_S_Pl_P_G<-cld(eLM2_S_Pl_P_G,ajust="tukey")
mcLM2_S_Pl_P_G$.group<-as.numeric(mcLM2_S_Pl_P_G$.group)
mcLM2_S_Pl_P_G$group[mcLM2_S_Pl_P_G$.group == 1] <- "a"
mcLM2_S_Pl_P_G$group[mcLM2_S_Pl_P_G$.group == 2] <- "b"
mcLM2_S_Pl_P_G
##  Periode     emmean    SE   df lower.CL upper.CL .group group
##  Mi-juillet    1.05 0.384 2.71   -0.254     2.35      1 a    
##  Juin          1.07 0.387 2.76   -0.221     2.37      1 a    
##  Fin juillet   1.37 0.399 3.08    0.119     2.62      1 a    
## 
## Degrees-of-freedom method: kenward-roger 
## Results are given on the sqrt (not the response) scale. 
## Confidence level used: 0.95 
## Note: contrasts are still on the sqrt scale 
## P value adjustment: tukey method for comparing a family of 3 estimates 
## significance level used: alpha = 0.05 
## NOTE: If two or more means share the same grouping symbol,
##       then we cannot show them to be different.
##       But we also did not show them to be the same.
CM2_S_Pl_P_F <- Inv %>% 
  filter(Gestion_moment_5 == "Fleuri")
LM2_S_Pl_P_F <- lmer(sqrt(S_Plant) ~ Area_gis_m_sq + Temperature + Periode + (1|Parcelle), data = CM2_S_Pl_P_F)
eLM2_S_Pl_P_F<-emmeans(LM2_S_Pl_P_F,"Periode")
mcLM2_S_Pl_P_F<-cld(eLM2_S_Pl_P_F,ajust="tukey")
mcLM2_S_Pl_P_F$.group<-as.numeric(mcLM2_S_Pl_P_F$.group)
mcLM2_S_Pl_P_F$group[mcLM2_S_Pl_P_F$.group == 1] <- "a"
mcLM2_S_Pl_P_F$group[mcLM2_S_Pl_P_F$.group == 2] <- "b"
mcLM2_S_Pl_P_F
##  Periode     emmean    SE   df lower.CL upper.CL .group group
##  Fin juillet   1.93 0.186 14.5     1.53     2.33      1 a    
##  Mi-juillet    2.31 0.175 12.1     1.92     2.69      2 b    
##  Juin          2.47 0.175 12.1     2.08     2.85      2 b    
## 
## Degrees-of-freedom method: kenward-roger 
## Results are given on the sqrt (not the response) scale. 
## Confidence level used: 0.95 
## Note: contrasts are still on the sqrt scale 
## P value adjustment: tukey method for comparing a family of 3 estimates 
## significance level used: alpha = 0.05 
## NOTE: If two or more means share the same grouping symbol,
##       then we cannot show them to be different.
##       But we also did not show them to be the same.
CM2_S_Pl_P_S <- Inv %>% 
  filter(Gestion_moment_5 == "Semé")
LM2_S_Pl_P_S <- lmer(sqrt(S_Plant) ~ Area_gis_m_sq + Temperature + Periode + (1|Parcelle), data = CM2_S_Pl_P_S)
eLM2_S_Pl_P_S<-emmeans(LM2_S_Pl_P_S,"Periode")
mcLM2_S_Pl_P_S<-cld(eLM2_S_Pl_P_S,ajust="tukey")
mcLM2_S_Pl_P_S$.group<-as.numeric(mcLM2_S_Pl_P_S$.group)
mcLM2_S_Pl_P_S$group[mcLM2_S_Pl_P_S$.group == 1] <- "a"
mcLM2_S_Pl_P_S$group[mcLM2_S_Pl_P_S$.group == 2] <- "b"
mcLM2_S_Pl_P_S
##  Periode     emmean    SE   df lower.CL upper.CL .group group
##  Fin juillet   2.80 0.183 8.58     2.39     3.22      1 a    
##  Mi-juillet    2.97 0.178 8.19     2.56     3.38      1 a    
##  Juin          3.06 0.177 8.12     2.65     3.47      1 a    
## 
## Degrees-of-freedom method: kenward-roger 
## Results are given on the sqrt (not the response) scale. 
## Confidence level used: 0.95 
## Note: contrasts are still on the sqrt scale 
## P value adjustment: tukey method for comparing a family of 3 estimates 
## significance level used: alpha = 0.05 
## NOTE: If two or more means share the same grouping symbol,
##       then we cannot show them to be different.
##       But we also did not show them to be the same.
CM2_S_Pl_P_Tr <- Inv %>% 
  filter(Gestion_moment_5 == "Tonte récente")
LM2_S_Pl_P_Tr <- lmer(sqrt(S_Plant) ~ Area_gis_m_sq + Temperature + Periode + (1|Parcelle), data = CM2_S_Pl_P_Tr)
eLM2_S_Pl_P_Tr<-emmeans(LM2_S_Pl_P_Tr,"Periode")
mcLM2_S_Pl_P_Tr<-cld(eLM2_S_Pl_P_Tr,ajust="tukey")
mcLM2_S_Pl_P_Tr$.group<-as.numeric(mcLM2_S_Pl_P_Tr$.group)
mcLM2_S_Pl_P_Tr$group[mcLM2_S_Pl_P_Tr$.group == 1] <- "a"
mcLM2_S_Pl_P_Tr$group[mcLM2_S_Pl_P_Tr$.group == 2] <- "b"
mcLM2_S_Pl_P_Tr
##  Periode     emmean    SE   df lower.CL upper.CL .group group
##  Fin juillet   1.18 0.245 19.8    0.664     1.69      1 a    
##  Mi-juillet    1.22 0.136 21.0    0.939     1.50      1 a    
##  Juin          1.54 0.182 20.9    1.158     1.92      1 a    
## 
## Degrees-of-freedom method: kenward-roger 
## Results are given on the sqrt (not the response) scale. 
## Confidence level used: 0.95 
## Note: contrasts are still on the sqrt scale 
## P value adjustment: tukey method for comparing a family of 3 estimates 
## significance level used: alpha = 0.05 
## NOTE: If two or more means share the same grouping symbol,
##       then we cannot show them to be different.
##       But we also did not show them to be the same.
CM2_S_Pl_P_Tt <- Inv %>% 
  filter(Gestion_moment_5 == "Tonte tardive")
LM2_S_Pl_P_Tt <- lmer(sqrt(S_Plant) ~ Area_gis_m_sq + Temperature + Periode + (1|Parcelle), data = CM2_S_Pl_P_Tt)
eLM2_S_Pl_P_Tt<-emmeans(LM2_S_Pl_P_Tt,"Periode")
mcLM2_S_Pl_P_Tt<-cld(eLM2_S_Pl_P_Tt,ajust="tukey")
mcLM2_S_Pl_P_Tt$.group<-as.numeric(mcLM2_S_Pl_P_Tt$.group)
mcLM2_S_Pl_P_Tt$group[mcLM2_S_Pl_P_Tt$.group == 1] <- "a"
mcLM2_S_Pl_P_Tt$group[mcLM2_S_Pl_P_Tt$.group == 2] <- "b"
mcLM2_S_Pl_P_Tt
##  Periode     emmean     SE   df lower.CL upper.CL .group group
##  Fin juillet   1.72 0.0882 43.2     1.54     1.90      1 a    
##  Juin          1.90 0.0992 43.4     1.70     2.10      1 a    
##  Mi-juillet    1.91 0.1122 44.0     1.69     2.14      1 a    
## 
## Degrees-of-freedom method: kenward-roger 
## Results are given on the sqrt (not the response) scale. 
## Confidence level used: 0.95 
## Note: contrasts are still on the sqrt scale 
## P value adjustment: tukey method for comparing a family of 3 estimates 
## significance level used: alpha = 0.05 
## NOTE: If two or more means share the same grouping symbol,
##       then we cannot show them to be different.
##       But we also did not show them to be the same.
eLM2_S_Pl_G5<-emmeans(LM2_S_Pl,"Gestion_moment_5")
mcLM2_S_Pl_G5<-cld(eLM2_S_Pl_G5,ajust="tukey")
mcLM2_S_Pl_G5$.group<-as.numeric(mcLM2_S_Pl_G5$.group)
mcLM2_S_Pl_G5$group[mcLM2_S_Pl_G5$.group == 1] <- "a"
mcLM2_S_Pl_G5$group[mcLM2_S_Pl_G5$.group == 2] <- "b"
mcLM2_S_Pl_G5$group[mcLM2_S_Pl_G5$.group == 3] <- "c"
mcLM2_S_Pl_G5$group[mcLM2_S_Pl_G5$.group == 23] <- "bc"
mcLM2_S_Pl_G5
##  Gestion_moment_5 emmean    SE   df lower.CL upper.CL .group group
##  Graminées          1.06 0.249 41.8    0.563     1.57      1 a    
##  Tonte récente      1.37 0.123 77.4    1.127     1.62      1 a    
##  Tonte tardive      1.84 0.106 49.6    1.627     2.05      2 b    
##  Fleuri             2.24 0.152 42.0    1.937     2.55     23 bc   
##  Semé               2.93 0.203 39.7    2.516     3.34      3 c    
## 
## Results are averaged over the levels of: Periode 
## Degrees-of-freedom method: kenward-roger 
## Results are given on the sqrt (not the response) scale. 
## Confidence level used: 0.95 
## Note: contrasts are still on the sqrt scale 
## P value adjustment: tukey method for comparing a family of 5 estimates 
## significance level used: alpha = 0.05 
## NOTE: If two or more means share the same grouping symbol,
##       then we cannot show them to be different.
##       But we also did not show them to be the same.

3.2.2.2 Ab Plant

LM2_Ab_Pl <- lmer(Ab_Plant ~ Area_gis_m_sq + Temperature + Periode * Gestion_moment_5 + (1|Parcelle), data = Inv)
# check_model(LM2_Ab_Pl)
# shapiro.test(residuals(LM2_Ab_Pl))

LM2_Ab_Pl <- lmer(sqrt(Ab_Plant) ~ Area_gis_m_sq + Temperature + Periode * Gestion_moment_5 + (1|Parcelle), data = Inv)
# check_model(LM2_Ab_Pl)
# shapiro.test(residuals(LM2_Ab_Pl))

step(LM2_Ab_Pl, direction = "backward") # sqrt(Ab_Plant) ~ Temperature + Periode + Gestion_moment_5 + (1 | Parcelle)
check_model(LM2_Ab_Pl)

Anova(LM2_Ab_Pl)
## Analysis of Deviance Table (Type II Wald chisquare tests)
## 
## Response: sqrt(Ab_Plant)
##                            Chisq Df Pr(>Chisq)    
## Area_gis_m_sq             0.2566  1     0.6125    
## Temperature               1.8593  1     0.1727    
## Periode                  41.7713  2  8.501e-10 ***
## Gestion_moment_5         44.9290  4  4.113e-09 ***
## Periode:Gestion_moment_5  7.1898  8     0.5163    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
# summary(LM2_Ab_Pl)
# LM2_Ab_Pl
eLM2_Ab_Pl_P<-emmeans(LM2_Ab_Pl,"Periode")
mcLM2_Ab_Pl_P<-cld(eLM2_Ab_Pl_P,ajust="tukey")
mcLM2_Ab_Pl_P$.group<-as.numeric(mcLM2_Ab_Pl_P$.group)
mcLM2_Ab_Pl_P$group[mcLM2_Ab_Pl_P$.group == 1] <- "b"
mcLM2_Ab_Pl_P$group[mcLM2_Ab_Pl_P$.group == 2] <- "a"
mcLM2_Ab_Pl_P
##  Periode     emmean    SE   df lower.CL upper.CL .group group
##  Fin juillet   6.07 0.670 92.8     4.74     7.40      1 b    
##  Mi-juillet    6.94 0.609 77.0     5.72     8.15      1 b    
##  Juin          8.78 0.616 79.0     7.55    10.00      2 a    
## 
## Results are averaged over the levels of: Gestion_moment_5 
## Degrees-of-freedom method: kenward-roger 
## Results are given on the sqrt (not the response) scale. 
## Confidence level used: 0.95 
## Note: contrasts are still on the sqrt scale 
## P value adjustment: tukey method for comparing a family of 3 estimates 
## significance level used: alpha = 0.05 
## NOTE: If two or more means share the same grouping symbol,
##       then we cannot show them to be different.
##       But we also did not show them to be the same.
CM2_Ab_Pl_P_G <- Inv %>% 
  filter(Gestion_moment_5 == "Graminées")
LM2_Ab_Pl_P_G <- lmer(sqrt(S_Plant) ~ Area_gis_m_sq + Temperature + Periode + (1|Parcelle), data = CM2_Ab_Pl_P_G)
eLM2_Ab_Pl_P_G<-emmeans(LM2_Ab_Pl_P_G,"Periode")
mcLM2_Ab_Pl_P_G<-cld(eLM2_Ab_Pl_P_G,ajust="tukey")
mcLM2_Ab_Pl_P_G$.group<-as.numeric(mcLM2_Ab_Pl_P_G$.group)
mcLM2_Ab_Pl_P_G$group[mcLM2_Ab_Pl_P_G$.group == 1] <- "a"
mcLM2_Ab_Pl_P_G$group[mcLM2_Ab_Pl_P_G$.group == 2] <- "b"
mcLM2_Ab_Pl_P_G
##  Periode     emmean    SE   df lower.CL upper.CL .group group
##  Mi-juillet    1.05 0.384 2.71   -0.254     2.35      1 a    
##  Juin          1.07 0.387 2.76   -0.221     2.37      1 a    
##  Fin juillet   1.37 0.399 3.08    0.119     2.62      1 a    
## 
## Degrees-of-freedom method: kenward-roger 
## Results are given on the sqrt (not the response) scale. 
## Confidence level used: 0.95 
## Note: contrasts are still on the sqrt scale 
## P value adjustment: tukey method for comparing a family of 3 estimates 
## significance level used: alpha = 0.05 
## NOTE: If two or more means share the same grouping symbol,
##       then we cannot show them to be different.
##       But we also did not show them to be the same.
CM2_Ab_Pl_P_F <- Inv %>% 
  filter(Gestion_moment_5 == "Fleuri")
LM2_Ab_Pl_P_F <- lmer(sqrt(S_Plant) ~ Area_gis_m_sq + Temperature + Periode + (1|Parcelle), data = CM2_Ab_Pl_P_F)
eLM2_Ab_Pl_P_F<-emmeans(LM2_Ab_Pl_P_F,"Periode")
mcLM2_Ab_Pl_P_F<-cld(eLM2_Ab_Pl_P_F,ajust="tukey")
mcLM2_Ab_Pl_P_F$.group<-as.numeric(mcLM2_Ab_Pl_P_F$.group)
mcLM2_Ab_Pl_P_F$group[mcLM2_Ab_Pl_P_F$.group == 1] <- "a"
mcLM2_Ab_Pl_P_F$group[mcLM2_Ab_Pl_P_F$.group == 2] <- "b"
mcLM2_Ab_Pl_P_F
##  Periode     emmean    SE   df lower.CL upper.CL .group group
##  Fin juillet   1.93 0.186 14.5     1.53     2.33      1 a    
##  Mi-juillet    2.31 0.175 12.1     1.92     2.69      2 b    
##  Juin          2.47 0.175 12.1     2.08     2.85      2 b    
## 
## Degrees-of-freedom method: kenward-roger 
## Results are given on the sqrt (not the response) scale. 
## Confidence level used: 0.95 
## Note: contrasts are still on the sqrt scale 
## P value adjustment: tukey method for comparing a family of 3 estimates 
## significance level used: alpha = 0.05 
## NOTE: If two or more means share the same grouping symbol,
##       then we cannot show them to be different.
##       But we also did not show them to be the same.
CM2_Ab_Pl_P_S <- Inv %>% 
  filter(Gestion_moment_5 == "Semé")
LM2_Ab_Pl_P_S <- lmer(sqrt(S_Plant) ~ Area_gis_m_sq + Temperature + Periode + (1|Parcelle), data = CM2_Ab_Pl_P_S)
eLM2_Ab_Pl_P_S<-emmeans(LM2_Ab_Pl_P_S,"Periode")
mcLM2_Ab_Pl_P_S<-cld(eLM2_Ab_Pl_P_S,ajust="tukey")
mcLM2_Ab_Pl_P_S$.group<-as.numeric(mcLM2_Ab_Pl_P_S$.group)
mcLM2_Ab_Pl_P_S$group[mcLM2_Ab_Pl_P_S$.group == 1] <- "a"
mcLM2_Ab_Pl_P_S$group[mcLM2_Ab_Pl_P_S$.group == 2] <- "b"
mcLM2_Ab_Pl_P_S
##  Periode     emmean    SE   df lower.CL upper.CL .group group
##  Fin juillet   2.80 0.183 8.58     2.39     3.22      1 a    
##  Mi-juillet    2.97 0.178 8.19     2.56     3.38      1 a    
##  Juin          3.06 0.177 8.12     2.65     3.47      1 a    
## 
## Degrees-of-freedom method: kenward-roger 
## Results are given on the sqrt (not the response) scale. 
## Confidence level used: 0.95 
## Note: contrasts are still on the sqrt scale 
## P value adjustment: tukey method for comparing a family of 3 estimates 
## significance level used: alpha = 0.05 
## NOTE: If two or more means share the same grouping symbol,
##       then we cannot show them to be different.
##       But we also did not show them to be the same.
CM2_Ab_Pl_P_Tr <- Inv %>% 
  filter(Gestion_moment_5 == "Tonte récente")
LM2_Ab_Pl_P_Tr <- lmer(sqrt(S_Plant) ~ Area_gis_m_sq + Temperature + Periode + (1|Parcelle), data = CM2_Ab_Pl_P_Tr)
eLM2_Ab_Pl_P_Tr<-emmeans(LM2_Ab_Pl_P_Tr,"Periode")
mcLM2_Ab_Pl_P_Tr<-cld(eLM2_Ab_Pl_P_Tr,ajust="tukey")
mcLM2_Ab_Pl_P_Tr$.group<-as.numeric(mcLM2_Ab_Pl_P_Tr$.group)
mcLM2_Ab_Pl_P_Tr$group[mcLM2_Ab_Pl_P_Tr$.group == 1] <- "a"
mcLM2_Ab_Pl_P_Tr$group[mcLM2_Ab_Pl_P_Tr$.group == 2] <- "b"
mcLM2_Ab_Pl_P_Tr
##  Periode     emmean    SE   df lower.CL upper.CL .group group
##  Fin juillet   1.18 0.245 19.8    0.664     1.69      1 a    
##  Mi-juillet    1.22 0.136 21.0    0.939     1.50      1 a    
##  Juin          1.54 0.182 20.9    1.158     1.92      1 a    
## 
## Degrees-of-freedom method: kenward-roger 
## Results are given on the sqrt (not the response) scale. 
## Confidence level used: 0.95 
## Note: contrasts are still on the sqrt scale 
## P value adjustment: tukey method for comparing a family of 3 estimates 
## significance level used: alpha = 0.05 
## NOTE: If two or more means share the same grouping symbol,
##       then we cannot show them to be different.
##       But we also did not show them to be the same.
CM2_Ab_Pl_P_Tt <- Inv %>% 
  filter(Gestion_moment_5 == "Tonte tardive")
LM2_Ab_Pl_P_Tt <- lmer(sqrt(S_Plant) ~ Area_gis_m_sq + Temperature + Periode + (1|Parcelle), data = CM2_Ab_Pl_P_Tt)
eLM2_Ab_Pl_P_Tt<-emmeans(LM2_Ab_Pl_P_Tt,"Periode")
mcLM2_Ab_Pl_P_Tt<-cld(eLM2_Ab_Pl_P_Tt,ajust="tukey")
mcLM2_Ab_Pl_P_Tt$.group<-as.numeric(mcLM2_Ab_Pl_P_Tt$.group)
mcLM2_Ab_Pl_P_Tt$group[mcLM2_Ab_Pl_P_Tt$.group == 1] <- "a"
mcLM2_Ab_Pl_P_Tt$group[mcLM2_Ab_Pl_P_Tt$.group == 2] <- "b"
mcLM2_Ab_Pl_P_Tt
##  Periode     emmean     SE   df lower.CL upper.CL .group group
##  Fin juillet   1.72 0.0882 43.2     1.54     1.90      1 a    
##  Juin          1.90 0.0992 43.4     1.70     2.10      1 a    
##  Mi-juillet    1.91 0.1122 44.0     1.69     2.14      1 a    
## 
## Degrees-of-freedom method: kenward-roger 
## Results are given on the sqrt (not the response) scale. 
## Confidence level used: 0.95 
## Note: contrasts are still on the sqrt scale 
## P value adjustment: tukey method for comparing a family of 3 estimates 
## significance level used: alpha = 0.05 
## NOTE: If two or more means share the same grouping symbol,
##       then we cannot show them to be different.
##       But we also did not show them to be the same.
eLM2_Ab_Pl_G5<-emmeans(LM2_Ab_Pl,"Gestion_moment_5")
mcLM2_Ab_Pl_G5<-cld(eLM2_Ab_Pl_G5,ajust="tukey")
mcLM2_Ab_Pl_G5$.group<-as.numeric(mcLM2_Ab_Pl_G5$.group)
mcLM2_Ab_Pl_G5$group[mcLM2_Ab_Pl_G5$.group == 1] <- "a"
mcLM2_Ab_Pl_G5$group[mcLM2_Ab_Pl_G5$.group == 2] <- "b"
mcLM2_Ab_Pl_G5$group[mcLM2_Ab_Pl_G5$.group == 3] <- "c"
mcLM2_Ab_Pl_G5$group[mcLM2_Ab_Pl_G5$.group == 23] <- "bc"
mcLM2_Ab_Pl_G5
##  Gestion_moment_5 emmean    SE   df lower.CL upper.CL .group group
##  Graminées          2.98 1.564 42.0   -0.174     6.14      1 a    
##  Tonte récente      5.11 0.816 85.1    3.483     6.73      1 a    
##  Tonte tardive      8.60 0.675 52.3    7.246     9.96      2 b    
##  Fleuri             8.72 0.956 42.4    6.793    10.65      2 b    
##  Semé              10.89 1.269 39.4    8.323    13.45      2 b    
## 
## Results are averaged over the levels of: Periode 
## Degrees-of-freedom method: kenward-roger 
## Results are given on the sqrt (not the response) scale. 
## Confidence level used: 0.95 
## Note: contrasts are still on the sqrt scale 
## P value adjustment: tukey method for comparing a family of 5 estimates 
## significance level used: alpha = 0.05 
## NOTE: If two or more means share the same grouping symbol,
##       then we cannot show them to be different.
##       But we also did not show them to be the same.

3.2.2.3 S Poll

LM2_S_Po <- lmer(S_Poll ~ Area_gis_m_sq + Temperature + Periode * Gestion_moment_5 + (1|Parcelle), data = Inv)
# check_model(LM2_S_Po)
# shapiro.test(residuals(LM2_S_Po))

LM2_S_Po <- lmer(sqrt(S_Poll) ~ Area_gis_m_sq + Temperature + Periode * Gestion_moment_5 + (1|Parcelle), data = Inv)
# check_model(LM2_S_Po)
# shapiro.test(residuals(LM2_S_Po))

step(LM2_S_Po, direction = "backward") 
# sqrt(S_Poll) ~ Periode + Gestion_moment_5 + (1 | Parcelle) + Periode:Gestion_moment_5
check_model(LM2_S_Po)

Anova(LM2_S_Po)
## Analysis of Deviance Table (Type II Wald chisquare tests)
## 
## Response: sqrt(S_Poll)
##                            Chisq Df Pr(>Chisq)    
## Area_gis_m_sq             0.0491  1    0.82467    
## Temperature               0.3952  1    0.52957    
## Periode                   7.6092  2    0.02227 *  
## Gestion_moment_5         93.2565  4    < 2e-16 ***
## Periode:Gestion_moment_5 18.1967  8    0.01980 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
# summary(LM2_S_Po)
# LM2_S_Po
eLM2_S_Po_P<-emmeans(LM2_S_Po,"Periode")
mcLM2_S_Po_P<-cld(eLM2_S_Po_P,ajust="tukey")
mcLM2_S_Po_P$.group<-as.numeric(mcLM2_S_Po_P$.group)
mcLM2_S_Po_P$group[mcLM2_S_Po_P$.group == 1] <- "a"
mcLM2_S_Po_P$group[mcLM2_S_Po_P$.group == 2] <- "b"
mcLM2_S_Po_P
##  Periode     emmean    SE    df lower.CL upper.CL .group group
##  Mi-juillet    2.08 0.123  94.0     1.84     2.33      1 a    
##  Fin juillet   2.11 0.139 106.5     1.83     2.38      1 a    
##  Juin          2.24 0.125  95.8     1.99     2.48      1 a    
## 
## Results are averaged over the levels of: Gestion_moment_5 
## Degrees-of-freedom method: kenward-roger 
## Results are given on the sqrt (not the response) scale. 
## Confidence level used: 0.95 
## Note: contrasts are still on the sqrt scale 
## P value adjustment: tukey method for comparing a family of 3 estimates 
## significance level used: alpha = 0.05 
## NOTE: If two or more means share the same grouping symbol,
##       then we cannot show them to be different.
##       But we also did not show them to be the same.
CM2_S_Po_P_G <- Inv %>% 
  filter(Gestion_moment_5 == "Graminées")
LM2_S_Po_P_G <- lmer(sqrt(S_Poll) ~ Area_gis_m_sq + Temperature + Periode + (1|Parcelle), data = CM2_S_Po_P_G)
eLM2_S_Po_P_G<-emmeans(LM2_S_Po_P_G,"Periode")
mcLM2_S_Po_P_G<-cld(eLM2_S_Po_P_G,ajust="tukey")
mcLM2_S_Po_P_G$.group<-as.numeric(mcLM2_S_Po_P_G$.group)
mcLM2_S_Po_P_G$group[mcLM2_S_Po_P_G$.group == 1] <- "a"
mcLM2_S_Po_P_G$group[mcLM2_S_Po_P_G$.group == 2] <- "b"
mcLM2_S_Po_P_G
##  Periode     emmean    SE   df lower.CL upper.CL .group group
##  Juin          1.15 0.638 5.85  -0.4187     2.72      1 a    
##  Mi-juillet    1.58 0.619 5.87   0.0596     3.10      1 a    
##  Fin juillet   2.46 0.711 5.99   0.7142     4.20      1 a    
## 
## Degrees-of-freedom method: kenward-roger 
## Results are given on the sqrt (not the response) scale. 
## Confidence level used: 0.95 
## Note: contrasts are still on the sqrt scale 
## P value adjustment: tukey method for comparing a family of 3 estimates 
## significance level used: alpha = 0.05 
## NOTE: If two or more means share the same grouping symbol,
##       then we cannot show them to be different.
##       But we also did not show them to be the same.
CM2_S_Po_P_F <- Inv %>% 
  filter(Gestion_moment_5 == "Fleuri")
LM2_S_Po_P_F <- lmer(sqrt(S_Poll) ~ Area_gis_m_sq + Temperature + Periode + (1|Parcelle), data = CM2_S_Po_P_F)
eLM2_S_Po_P_F<-emmeans(LM2_S_Po_P_F,"Periode")
mcLM2_S_Po_P_F<-cld(eLM2_S_Po_P_F,ajust="tukey")
mcLM2_S_Po_P_F$.group<-as.numeric(mcLM2_S_Po_P_F$.group)
mcLM2_S_Po_P_F$group[mcLM2_S_Po_P_F$.group == 1] <- "a"
mcLM2_S_Po_P_F$group[mcLM2_S_Po_P_F$.group == 2] <- "b"
mcLM2_S_Po_P_F
##  Periode     emmean    SE   df lower.CL upper.CL .group group
##  Fin juillet   2.60 0.255 20.0     2.07     3.13      1 a    
##  Mi-juillet    2.81 0.227 16.4     2.33     3.29      1 a    
##  Juin          2.98 0.228 16.5     2.50     3.47      1 a    
## 
## Degrees-of-freedom method: kenward-roger 
## Results are given on the sqrt (not the response) scale. 
## Confidence level used: 0.95 
## Note: contrasts are still on the sqrt scale 
## P value adjustment: tukey method for comparing a family of 3 estimates 
## significance level used: alpha = 0.05 
## NOTE: If two or more means share the same grouping symbol,
##       then we cannot show them to be different.
##       But we also did not show them to be the same.
CM2_S_Po_P_S <- Inv %>% 
  filter(Gestion_moment_5 == "Semé")
LM2_S_Po_P_S <- lmer(sqrt(S_Poll) ~ Area_gis_m_sq + Temperature + Periode + (1|Parcelle), data = CM2_S_Po_P_S)
eLM2_S_Po_P_S<-emmeans(LM2_S_Po_P_S,"Periode")
mcLM2_S_Po_P_S<-cld(eLM2_S_Po_P_S,ajust="tukey")
mcLM2_S_Po_P_S$.group<-as.numeric(mcLM2_S_Po_P_S$.group)
mcLM2_S_Po_P_S$group[mcLM2_S_Po_P_S$.group == 1] <- "a"
mcLM2_S_Po_P_S$group[mcLM2_S_Po_P_S$.group == 2] <- "b"
mcLM2_S_Po_P_S$group[mcLM2_S_Po_P_S$.group == 12] <- "ab"
mcLM2_S_Po_P_S
##  Periode     emmean    SE   df lower.CL upper.CL .group group
##  Fin juillet   2.97 0.208 11.3     2.51     3.43      1 a    
##  Mi-juillet    3.52 0.201 11.0     3.07     3.96     12 ab   
##  Juin          3.78 0.199 11.0     3.34     4.21      2 b    
## 
## Degrees-of-freedom method: kenward-roger 
## Results are given on the sqrt (not the response) scale. 
## Confidence level used: 0.95 
## Note: contrasts are still on the sqrt scale 
## P value adjustment: tukey method for comparing a family of 3 estimates 
## significance level used: alpha = 0.05 
## NOTE: If two or more means share the same grouping symbol,
##       then we cannot show them to be different.
##       But we also did not show them to be the same.
CM2_S_Po_P_Tr <- Inv %>% 
  filter(Gestion_moment_5 == "Tonte récente")
LM2_S_Po_P_Tr <- lmer(sqrt(S_Poll) ~ Area_gis_m_sq + Temperature + Periode + (1|Parcelle), data = CM2_S_Po_P_Tr)
eLM2_S_Po_P_Tr<-emmeans(LM2_S_Po_P_Tr,"Periode")
mcLM2_S_Po_P_Tr<-cld(eLM2_S_Po_P_Tr,ajust="tukey")
mcLM2_S_Po_P_Tr$.group<-as.numeric(mcLM2_S_Po_P_Tr$.group)
mcLM2_S_Po_P_Tr$group[mcLM2_S_Po_P_Tr$.group == 1] <- "a"
mcLM2_S_Po_P_Tr$group[mcLM2_S_Po_P_Tr$.group == 2] <- "b"
mcLM2_S_Po_P_Tr
##  Periode     emmean    SE   df lower.CL upper.CL .group group
##  Mi-juillet   0.874 0.182 21.0    0.495     1.25      1 a    
##  Fin juillet  1.060 0.329 19.8    0.373     1.75      1 a    
##  Juin         1.407 0.244 20.9    0.898     1.91      1 a    
## 
## Degrees-of-freedom method: kenward-roger 
## Results are given on the sqrt (not the response) scale. 
## Confidence level used: 0.95 
## Note: contrasts are still on the sqrt scale 
## P value adjustment: tukey method for comparing a family of 3 estimates 
## significance level used: alpha = 0.05 
## NOTE: If two or more means share the same grouping symbol,
##       then we cannot show them to be different.
##       But we also did not show them to be the same.
CM2_S_Po_P_Tt <- Inv %>% 
  filter(Gestion_moment_5 == "Tonte tardive")
LM2_S_Po_P_Tt <- lmer(sqrt(S_Poll) ~ Area_gis_m_sq + Temperature + Periode + (1|Parcelle), data = CM2_S_Po_P_Tt)
eLM2_S_Po_P_Tt<-emmeans(LM2_S_Po_P_Tt,"Periode")
mcLM2_S_Po_P_Tt<-cld(eLM2_S_Po_P_Tt,ajust="tukey")
mcLM2_S_Po_P_Tt$.group<-as.numeric(mcLM2_S_Po_P_Tt$.group)
mcLM2_S_Po_P_Tt$group[mcLM2_S_Po_P_Tt$.group == 1] <- "a"
mcLM2_S_Po_P_Tt$group[mcLM2_S_Po_P_Tt$.group == 2] <- "b"
mcLM2_S_Po_P_Tt$group[mcLM2_S_Po_P_Tt$.group == 12] <- "ab"
mcLM2_S_Po_P_Tt
##  Periode     emmean    SE   df lower.CL upper.CL .group group
##  Fin juillet   1.37 0.143 44.0     1.08     1.66      1 a    
##  Mi-juillet    1.87 0.185 44.0     1.50     2.24     12 ab   
##  Juin          1.92 0.161 43.7     1.60     2.25      2 b    
## 
## Degrees-of-freedom method: kenward-roger 
## Results are given on the sqrt (not the response) scale. 
## Confidence level used: 0.95 
## Note: contrasts are still on the sqrt scale 
## P value adjustment: tukey method for comparing a family of 3 estimates 
## significance level used: alpha = 0.05 
## NOTE: If two or more means share the same grouping symbol,
##       then we cannot show them to be different.
##       But we also did not show them to be the same.
eLM2_S_Po_G5<-emmeans(LM2_S_Po,"Gestion_moment_5")
mcLM2_S_Po_G5<-cld(eLM2_S_Po_G5,ajust="tukey")
mcLM2_S_Po_G5$.group<-as.numeric(mcLM2_S_Po_G5$.group)
mcLM2_S_Po_G5$group[mcLM2_S_Po_G5$.group == 1] <- "a"
mcLM2_S_Po_G5$group[mcLM2_S_Po_G5$.group == 2] <- "b"
mcLM2_S_Po_G5$group[mcLM2_S_Po_G5$.group == 3] <- "c"
mcLM2_S_Po_G5$group[mcLM2_S_Po_G5$.group == 12] <- "ab"
mcLM2_S_Po_G5
##  Gestion_moment_5 emmean    SE   df lower.CL upper.CL .group group
##  Tonte récente      1.09 0.167 95.1    0.759     1.42      1 a    
##  Graminées          1.67 0.292 42.3    1.079     2.26     12 ab   
##  Tonte tardive      1.72 0.130 57.4    1.455     1.98      2 b    
##  Fleuri             2.83 0.179 43.0    2.466     3.19      3 c    
##  Semé               3.41 0.235 38.6    2.932     3.88      3 c    
## 
## Results are averaged over the levels of: Periode 
## Degrees-of-freedom method: kenward-roger 
## Results are given on the sqrt (not the response) scale. 
## Confidence level used: 0.95 
## Note: contrasts are still on the sqrt scale 
## P value adjustment: tukey method for comparing a family of 5 estimates 
## significance level used: alpha = 0.05 
## NOTE: If two or more means share the same grouping symbol,
##       then we cannot show them to be different.
##       But we also did not show them to be the same.
CM2_S_Po_G5_Ju <- Inv %>% 
  filter(Periode == "Juin")
LM2_S_Po_G5_Ju <- lm(sqrt(S_Poll) ~ Area_gis_m_sq + Temperature + Gestion_moment_5, data = CM2_S_Po_G5_Ju)
eLM2_S_Po_G5_Ju<-emmeans(LM2_S_Po_G5_Ju,"Gestion_moment_5")
mcLM2_S_Po_G5_Ju<-cld(eLM2_S_Po_G5_Ju,ajust="tukey")
mcLM2_S_Po_G5_Ju$.group<-as.numeric(mcLM2_S_Po_G5_Ju$.group)
mcLM2_S_Po_G5_Ju$group[mcLM2_S_Po_G5_Ju$.group == 1] <- "a"
mcLM2_S_Po_G5_Ju$group[mcLM2_S_Po_G5_Ju$.group == 2] <- "b"
mcLM2_S_Po_G5_Ju
##  Gestion_moment_5 emmean    SE df lower.CL upper.CL .group group
##  Graminées          1.13 0.317 39    0.488     1.77      1 a    
##  Tonte récente      1.33 0.232 39    0.860     1.80      1 a    
##  Tonte tardive      1.92 0.163 39    1.593     2.25      1 a    
##  Fleuri             3.06 0.194 39    2.664     3.45      2 b    
##  Semé               3.75 0.262 39    3.215     4.28      2 b    
## 
## Results are given on the sqrt (not the response) scale. 
## Confidence level used: 0.95 
## Note: contrasts are still on the sqrt scale 
## P value adjustment: tukey method for comparing a family of 5 estimates 
## significance level used: alpha = 0.05 
## NOTE: If two or more means share the same grouping symbol,
##       then we cannot show them to be different.
##       But we also did not show them to be the same.
CM2_S_Po_G5_mJ <- Inv %>% 
  filter(Periode == "Mi-juillet")
LM2_S_Po_G5_mJ <- lm(sqrt(S_Poll) ~ Area_gis_m_sq + Temperature + Gestion_moment_5, data = CM2_S_Po_G5_mJ)
eLM2_S_Po_G5_mJ<-emmeans(LM2_S_Po_G5_mJ,"Gestion_moment_5")
mcLM2_S_Po_G5_mJ<-cld(eLM2_S_Po_G5_mJ,ajust="tukey")
mcLM2_S_Po_G5_mJ$.group<-as.numeric(mcLM2_S_Po_G5_mJ$.group)
mcLM2_S_Po_G5_mJ$group[mcLM2_S_Po_G5_mJ$.group == 1] <- "a"
mcLM2_S_Po_G5_mJ$group[mcLM2_S_Po_G5_mJ$.group == 12] <- "ab"
mcLM2_S_Po_G5_mJ$group[mcLM2_S_Po_G5_mJ$.group == 23] <- "bc"
mcLM2_S_Po_G5_mJ$group[mcLM2_S_Po_G5_mJ$.group == 34] <- "cd"
mcLM2_S_Po_G5_mJ$group[mcLM2_S_Po_G5_mJ$.group == 4] <- "d"
mcLM2_S_Po_G5_mJ
##  Gestion_moment_5 emmean    SE df lower.CL upper.CL .group group
##  Tonte récente     0.888 0.228 39    0.426     1.35      1 a    
##  Graminées         1.149 0.422 39    0.294     2.00     12 ab   
##  Tonte tardive     1.948 0.245 39    1.453     2.44     23 bc   
##  Fleuri            2.807 0.255 39    2.292     3.32     34 cd   
##  Semé              3.449 0.341 39    2.760     4.14      4 d    
## 
## Results are given on the sqrt (not the response) scale. 
## Confidence level used: 0.95 
## Note: contrasts are still on the sqrt scale 
## P value adjustment: tukey method for comparing a family of 5 estimates 
## significance level used: alpha = 0.05 
## NOTE: If two or more means share the same grouping symbol,
##       then we cannot show them to be different.
##       But we also did not show them to be the same.
CM2_S_Po_G5_fJ <- Inv %>% 
  filter(Periode == "Fin juillet")
LM2_S_Po_G5_fJ <- lm(sqrt(S_Poll) ~ Area_gis_m_sq + Temperature + Gestion_moment_5, data = CM2_S_Po_G5_fJ)
eLM2_S_Po_G5_fJ<-emmeans(LM2_S_Po_G5_fJ,"Gestion_moment_5")
mcLM2_S_Po_G5_fJ<-cld(eLM2_S_Po_G5_fJ,ajust="tukey")
mcLM2_S_Po_G5_fJ$.group<-as.numeric(mcLM2_S_Po_G5_fJ$.group)
mcLM2_S_Po_G5_fJ$group[mcLM2_S_Po_G5_fJ$.group == 1] <- "a"
mcLM2_S_Po_G5_fJ$group[mcLM2_S_Po_G5_fJ$.group == 2] <- "b"
mcLM2_S_Po_G5_fJ$group[mcLM2_S_Po_G5_fJ$.group == 12] <- "ab"
mcLM2_S_Po_G5_fJ
##  Gestion_moment_5 emmean    SE df lower.CL upper.CL .group group
##  Tonte récente      0.99 0.333 35    0.314     1.67      1 a    
##  Tonte tardive      1.37 0.164 35    1.042     1.71      1 a    
##  Fleuri             2.61 0.261 35    2.077     3.14      2 b    
##  Graminées          2.81 0.420 35    1.957     3.66      2 b    
##  Semé               3.06 0.308 35    2.434     3.69      2 b    
## 
## Results are given on the sqrt (not the response) scale. 
## Confidence level used: 0.95 
## Note: contrasts are still on the sqrt scale 
## P value adjustment: tukey method for comparing a family of 5 estimates 
## significance level used: alpha = 0.05 
## NOTE: If two or more means share the same grouping symbol,
##       then we cannot show them to be different.
##       But we also did not show them to be the same.

3.2.2.4 Ab Poll

LM2_Ab_Po <- lmer(Ab_Poll ~ Area_gis_m_sq + Temperature + Periode * Gestion_moment_5 + (1|Parcelle), data = Inv)
# check_model(LM2_Ab_Po)
# shapiro.test(residuals(LM2_Ab_Po))

LM2_Ab_Po <- lmer(sqrt(Ab_Poll) ~ Area_gis_m_sq + Temperature + Periode * Gestion_moment_5 + (1|Parcelle), data = Inv)
# check_model(LM2_Ab_Po)
# shapiro.test(residuals(LM2_Ab_Po))

step(LM2_Ab_Po, direction = "backward") # sqrt(Ab_Poll) ~ Periode + Gestion_moment_5 + (1 | Parcelle) + Periode:Gestion_moment_5
check_model(LM2_Ab_Po)

Anova(LM2_Ab_Po)
## Analysis of Deviance Table (Type II Wald chisquare tests)
## 
## Response: sqrt(Ab_Poll)
##                             Chisq Df Pr(>Chisq)    
## Area_gis_m_sq              0.1000  1  0.7518512    
## Temperature                0.5316  1  0.4659370    
## Periode                    9.6825  2  0.0078974 ** 
## Gestion_moment_5         116.0088  4  < 2.2e-16 ***
## Periode:Gestion_moment_5  29.0253  8  0.0003139 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
# summary(LM2_Ab_Po)
# LM2_Ab_Po
eLM2_Ab_Po_P<-emmeans(LM2_Ab_Po,"Periode")
mcLM2_Ab_Po_P<-cld(eLM2_Ab_Po_P,ajust="tukey")
mcLM2_Ab_Po_P$.group<-as.numeric(mcLM2_Ab_Po_P$.group)
mcLM2_Ab_Po_P$group[mcLM2_Ab_Po_P$.group == 1] <- "a"
mcLM2_Ab_Po_P$group[mcLM2_Ab_Po_P$.group == 2] <- "b"
mcLM2_Ab_Po_P
##  Periode     emmean    SE    df lower.CL upper.CL .group group
##  Fin juillet   3.01 0.232 108.4     2.55     3.47      1 a    
##  Juin          3.13 0.208  98.8     2.72     3.54      1 a    
##  Mi-juillet    3.35 0.205  97.2     2.94     3.76      1 a    
## 
## Results are averaged over the levels of: Gestion_moment_5 
## Degrees-of-freedom method: kenward-roger 
## Results are given on the sqrt (not the response) scale. 
## Confidence level used: 0.95 
## Note: contrasts are still on the sqrt scale 
## P value adjustment: tukey method for comparing a family of 3 estimates 
## significance level used: alpha = 0.05 
## NOTE: If two or more means share the same grouping symbol,
##       then we cannot show them to be different.
##       But we also did not show them to be the same.
CM2_S_Ab_P_G <- Inv %>% 
  filter(Gestion_moment_5 == "Graminées")
LM2_S_Ab_P_G <- lmer(sqrt(Ab_Poll) ~ Area_gis_m_sq + Temperature + Periode + (1|Parcelle), data = CM2_S_Ab_P_G)
eLM2_S_Ab_P_G<-emmeans(LM2_S_Ab_P_G,"Periode")
mcLM2_S_Ab_P_G<-cld(eLM2_S_Ab_P_G,ajust="tukey")
mcLM2_S_Ab_P_G$.group<-as.numeric(mcLM2_S_Ab_P_G$.group)
mcLM2_S_Ab_P_G$group[mcLM2_S_Ab_P_G$.group == 1] <- "a"
mcLM2_S_Ab_P_G$group[mcLM2_S_Ab_P_G$.group == 2] <- "b"
mcLM2_S_Ab_P_G
##  Periode     emmean   SE   df lower.CL upper.CL .group group
##  Juin          1.13 1.06 5.85   -1.475     3.73      1 a    
##  Mi-juillet    2.37 1.03 5.87   -0.157     4.89      1 a    
##  Fin juillet   3.68 1.18 5.99    0.797     6.57      1 a    
## 
## Degrees-of-freedom method: kenward-roger 
## Results are given on the sqrt (not the response) scale. 
## Confidence level used: 0.95 
## Note: contrasts are still on the sqrt scale 
## P value adjustment: tukey method for comparing a family of 3 estimates 
## significance level used: alpha = 0.05 
## NOTE: If two or more means share the same grouping symbol,
##       then we cannot show them to be different.
##       But we also did not show them to be the same.
CM2_S_Ab_P_F <- Inv %>% 
  filter(Gestion_moment_5 == "Fleuri")
LM2_S_Ab_P_F <- lmer(sqrt(Ab_Poll) ~ Area_gis_m_sq + Temperature + Periode + (1|Parcelle), data = CM2_S_Ab_P_F)
eLM2_S_Ab_P_F<-emmeans(LM2_S_Ab_P_F,"Periode")
mcLM2_S_Ab_P_F<-cld(eLM2_S_Ab_P_F,ajust="tukey")
mcLM2_S_Ab_P_F$.group<-as.numeric(mcLM2_S_Ab_P_F$.group)
mcLM2_S_Ab_P_F$group[mcLM2_S_Ab_P_F$.group == 1] <- "a"
mcLM2_S_Ab_P_F$group[mcLM2_S_Ab_P_F$.group == 2] <- "b"
mcLM2_S_Ab_P_F
##  Periode     emmean    SE   df lower.CL upper.CL .group group
##  Fin juillet   3.33 0.471 18.5     2.34     4.31      1 a    
##  Mi-juillet    4.14 0.427 15.0     3.23     5.05      1 a    
##  Juin          4.43 0.429 15.2     3.52     5.34      1 a    
## 
## Degrees-of-freedom method: kenward-roger 
## Results are given on the sqrt (not the response) scale. 
## Confidence level used: 0.95 
## Note: contrasts are still on the sqrt scale 
## P value adjustment: tukey method for comparing a family of 3 estimates 
## significance level used: alpha = 0.05 
## NOTE: If two or more means share the same grouping symbol,
##       then we cannot show them to be different.
##       But we also did not show them to be the same.
CM2_S_Ab_P_S <- Inv %>% 
  filter(Gestion_moment_5 == "Semé")
LM2_S_Ab_P_S <- lmer(sqrt(Ab_Poll) ~ Area_gis_m_sq + Temperature + Periode + (1|Parcelle), data = CM2_S_Ab_P_S)
eLM2_S_Ab_P_S<-emmeans(LM2_S_Ab_P_S,"Periode")
mcLM2_S_Ab_P_S<-cld(eLM2_S_Ab_P_S,ajust="tukey")
mcLM2_S_Ab_P_S$.group<-as.numeric(mcLM2_S_Ab_P_S$.group)
mcLM2_S_Ab_P_S$group[mcLM2_S_Ab_P_S$.group == 1] <- "a"
mcLM2_S_Ab_P_S$group[mcLM2_S_Ab_P_S$.group == 2] <- "b"
mcLM2_S_Ab_P_S$group[mcLM2_S_Ab_P_S$.group == 12] <- "ab"
mcLM2_S_Ab_P_S
##  Periode     emmean    SE   df lower.CL upper.CL .group group
##  Fin juillet   4.73 0.384 11.1     3.88     5.57      1 a    
##  Juin          5.43 0.369 10.8     4.61     6.24      1 a    
##  Mi-juillet    6.95 0.371 10.8     6.13     7.76      2 b    
## 
## Degrees-of-freedom method: kenward-roger 
## Results are given on the sqrt (not the response) scale. 
## Confidence level used: 0.95 
## Note: contrasts are still on the sqrt scale 
## P value adjustment: tukey method for comparing a family of 3 estimates 
## significance level used: alpha = 0.05 
## NOTE: If two or more means share the same grouping symbol,
##       then we cannot show them to be different.
##       But we also did not show them to be the same.
CM2_S_Ab_P_Tr <- Inv %>% 
  filter(Gestion_moment_5 == "Tonte récente")
LM2_S_Ab_P_Tr <- lmer(sqrt(Ab_Poll) ~ Area_gis_m_sq + Temperature + Periode + (1|Parcelle), data = CM2_S_Ab_P_Tr)
eLM2_S_Ab_P_Tr<-emmeans(LM2_S_Ab_P_Tr,"Periode")
mcLM2_S_Ab_P_Tr<-cld(eLM2_S_Ab_P_Tr,ajust="tukey")
mcLM2_S_Ab_P_Tr$.group<-as.numeric(mcLM2_S_Ab_P_Tr$.group)
mcLM2_S_Ab_P_Tr$group[mcLM2_S_Ab_P_Tr$.group == 1] <- "a"
mcLM2_S_Ab_P_Tr$group[mcLM2_S_Ab_P_Tr$.group == 2] <- "b"
mcLM2_S_Ab_P_Tr
##  Periode     emmean    SE   df lower.CL upper.CL .group group
##  Mi-juillet    0.92 0.218 21.0    0.465     1.37      1 a    
##  Fin juillet   1.33 0.394 19.8    0.506     2.15      1 a    
##  Juin          1.62 0.293 20.9    1.014     2.23      1 a    
## 
## Degrees-of-freedom method: kenward-roger 
## Results are given on the sqrt (not the response) scale. 
## Confidence level used: 0.95 
## Note: contrasts are still on the sqrt scale 
## P value adjustment: tukey method for comparing a family of 3 estimates 
## significance level used: alpha = 0.05 
## NOTE: If two or more means share the same grouping symbol,
##       then we cannot show them to be different.
##       But we also did not show them to be the same.
CM2_S_Ab_P_Tt <- Inv %>% 
  filter(Gestion_moment_5 == "Tonte tardive")
LM2_S_Ab_P_Tt <- lmer(sqrt(Ab_Poll) ~ Area_gis_m_sq + Temperature + Periode + (1|Parcelle), data = CM2_S_Ab_P_Tt)
eLM2_S_Ab_P_Tt<-emmeans(LM2_S_Ab_P_Tt,"Periode")
mcLM2_S_Ab_P_Tt<-cld(eLM2_S_Ab_P_Tt,ajust="tukey")
mcLM2_S_Ab_P_Tt$.group<-as.numeric(mcLM2_S_Ab_P_Tt$.group)
mcLM2_S_Ab_P_Tt$group[mcLM2_S_Ab_P_Tt$.group == 1] <- "a"
mcLM2_S_Ab_P_Tt$group[mcLM2_S_Ab_P_Tt$.group == 2] <- "b"
mcLM2_S_Ab_P_Tt$group[mcLM2_S_Ab_P_Tt$.group == 12] <- "ab"
mcLM2_S_Ab_P_Tt
##  Periode     emmean    SE   df lower.CL upper.CL .group group
##  Fin juillet   1.85 0.251 43.2     1.34     2.35      1 a    
##  Mi-juillet    2.70 0.319 44.0     2.05     3.34     12 ab   
##  Juin          3.03 0.282 43.4     2.47     3.60      2 b    
## 
## Degrees-of-freedom method: kenward-roger 
## Results are given on the sqrt (not the response) scale. 
## Confidence level used: 0.95 
## Note: contrasts are still on the sqrt scale 
## P value adjustment: tukey method for comparing a family of 3 estimates 
## significance level used: alpha = 0.05 
## NOTE: If two or more means share the same grouping symbol,
##       then we cannot show them to be different.
##       But we also did not show them to be the same.
eLM2_Ab_Po_G5<-emmeans(LM2_Ab_Po,"Gestion_moment_5")
mcLM2_Ab_Po_G5<-cld(eLM2_Ab_Po_G5,ajust="tukey")
mcLM2_Ab_Po_G5$.group<-as.numeric(mcLM2_Ab_Po_G5$.group)
mcLM2_Ab_Po_G5$group[mcLM2_Ab_Po_G5$.group == 1] <- "a"
mcLM2_Ab_Po_G5$group[mcLM2_Ab_Po_G5$.group == 2] <- "b"
mcLM2_Ab_Po_G5$group[mcLM2_Ab_Po_G5$.group == 3] <- "c"
mcLM2_Ab_Po_G5$group[mcLM2_Ab_Po_G5$.group == 12] <- "ab"
mcLM2_Ab_Po_G5$group[mcLM2_Ab_Po_G5$.group == 4] <- "d"
mcLM2_Ab_Po_G5
##  Gestion_moment_5 emmean    SE   df lower.CL upper.CL .group group
##  Tonte récente      1.23 0.278 96.5    0.679     1.78      1 a    
##  Graminées          2.36 0.479 42.4    1.393     3.32     12 ab   
##  Tonte tardive      2.53 0.214 58.4    2.100     2.96      2 b    
##  Fleuri             3.97 0.293 43.1    3.383     4.56      3 c    
##  Semé               5.73 0.384 38.5    4.952     6.50      4 d    
## 
## Results are averaged over the levels of: Periode 
## Degrees-of-freedom method: kenward-roger 
## Results are given on the sqrt (not the response) scale. 
## Confidence level used: 0.95 
## Note: contrasts are still on the sqrt scale 
## P value adjustment: tukey method for comparing a family of 5 estimates 
## significance level used: alpha = 0.05 
## NOTE: If two or more means share the same grouping symbol,
##       then we cannot show them to be different.
##       But we also did not show them to be the same.
CM2_Ab_Po_G5_Ju <- Inv %>% 
  filter(Periode == "Juin")
LM2_Ab_Po_G5_Ju <- lm(sqrt(Ab_Poll) ~ Area_gis_m_sq + Temperature + Gestion_moment_5, data = CM2_Ab_Po_G5_Ju)
eLM2_Ab_Po_G5_Ju<-emmeans(LM2_Ab_Po_G5_Ju,"Gestion_moment_5")
mcLM2_Ab_Po_G5_Ju<-cld(eLM2_Ab_Po_G5_Ju,ajust="tukey")
mcLM2_Ab_Po_G5_Ju$.group<-as.numeric(mcLM2_Ab_Po_G5_Ju$.group)
mcLM2_Ab_Po_G5_Ju$group[mcLM2_Ab_Po_G5_Ju$.group == 1] <- "a"
mcLM2_Ab_Po_G5_Ju$group[mcLM2_Ab_Po_G5_Ju$.group == 2] <- "b"
mcLM2_Ab_Po_G5_Ju$group[mcLM2_Ab_Po_G5_Ju$.group == 12] <- "ab"
mcLM2_Ab_Po_G5_Ju$group[mcLM2_Ab_Po_G5_Ju$.group == 3] <- "c"
mcLM2_Ab_Po_G5_Ju
##  Gestion_moment_5 emmean    SE df lower.CL upper.CL .group group
##  Graminées          1.29 0.557 39    0.168     2.42     12 ab   
##  Tonte récente      1.44 0.408 39    0.616     2.26      1 a    
##  Tonte tardive      2.92 0.287 39    2.343     3.50      2 b    
##  Fleuri             4.50 0.341 39    3.806     5.19      3 c    
##  Semé               5.39 0.461 39    4.459     6.32      3 c    
## 
## Results are given on the sqrt (not the response) scale. 
## Confidence level used: 0.95 
## Note: contrasts are still on the sqrt scale 
## P value adjustment: tukey method for comparing a family of 5 estimates 
## significance level used: alpha = 0.05 
## NOTE: If two or more means share the same grouping symbol,
##       then we cannot show them to be different.
##       But we also did not show them to be the same.
CM2_Ab_Po_G5_mJ <- Inv %>% 
  filter(Periode == "Mi-juillet")
LM2_Ab_Po_G5_mJ <- lm(sqrt(Ab_Poll) ~ Area_gis_m_sq + Temperature + Gestion_moment_5, data = CM2_Ab_Po_G5_mJ)
eLM2_Ab_Po_G5_mJ<-emmeans(LM2_Ab_Po_G5_mJ,"Gestion_moment_5")
mcLM2_Ab_Po_G5_mJ<-cld(eLM2_Ab_Po_G5_mJ,ajust="tukey")
mcLM2_Ab_Po_G5_mJ$.group<-as.numeric(mcLM2_Ab_Po_G5_mJ$.group)
mcLM2_Ab_Po_G5_mJ$group[mcLM2_Ab_Po_G5_mJ$.group == 1] <- "a"
mcLM2_Ab_Po_G5_mJ$group[mcLM2_Ab_Po_G5_mJ$.group == 12] <- "ab"
mcLM2_Ab_Po_G5_mJ$group[mcLM2_Ab_Po_G5_mJ$.group == 23] <- "bc"
mcLM2_Ab_Po_G5_mJ$group[mcLM2_Ab_Po_G5_mJ$.group == 3] <- "c"
mcLM2_Ab_Po_G5_mJ$group[mcLM2_Ab_Po_G5_mJ$.group == 4] <- "d"
mcLM2_Ab_Po_G5_mJ
##  Gestion_moment_5 emmean    SE df lower.CL upper.CL .group group
##  Tonte récente     0.932 0.341 39    0.241     1.62      1 a    
##  Graminées         1.627 0.631 39    0.351     2.90     12 ab   
##  Tonte tardive     2.929 0.365 39    2.190     3.67     23 bc   
##  Fleuri            4.168 0.381 39    3.399     4.94      3 c    
##  Semé              6.872 0.509 39    5.843     7.90      4 d    
## 
## Results are given on the sqrt (not the response) scale. 
## Confidence level used: 0.95 
## Note: contrasts are still on the sqrt scale 
## P value adjustment: tukey method for comparing a family of 5 estimates 
## significance level used: alpha = 0.05 
## NOTE: If two or more means share the same grouping symbol,
##       then we cannot show them to be different.
##       But we also did not show them to be the same.
CM2_Ab_Po_G5_fJ <- Inv %>% 
  filter(Periode == "Fin juillet")
LM2_Ab_Po_G5_fJ <- lm(sqrt(Ab_Poll) ~ Area_gis_m_sq + Temperature + Gestion_moment_5, data = CM2_Ab_Po_G5_fJ)
eLM2_Ab_Po_G5_fJ<-emmeans(LM2_Ab_Po_G5_fJ,"Gestion_moment_5")
mcLM2_Ab_Po_G5_fJ<-cld(eLM2_Ab_Po_G5_fJ,ajust="tukey")
mcLM2_Ab_Po_G5_fJ$.group<-as.numeric(mcLM2_Ab_Po_G5_fJ$.group)
mcLM2_Ab_Po_G5_fJ$group[mcLM2_Ab_Po_G5_fJ$.group == 1] <- "a"
mcLM2_Ab_Po_G5_fJ$group[mcLM2_Ab_Po_G5_fJ$.group == 2] <- "b"
mcLM2_Ab_Po_G5_fJ$group[mcLM2_Ab_Po_G5_fJ$.group == 12] <- "ab"
mcLM2_Ab_Po_G5_fJ
##  Gestion_moment_5 emmean    SE df lower.CL upper.CL .group group
##  Tonte récente      1.26 0.585 35   0.0763     2.45      1 a    
##  Tonte tardive      1.86 0.289 35   1.2705     2.44      1 a    
##  Fleuri             3.18 0.459 35   2.2468     4.11     12 ab   
##  Graminées          4.18 0.739 35   2.6801     5.68      2 b    
##  Semé               5.03 0.542 35   3.9281     6.13      2 b    
## 
## Results are given on the sqrt (not the response) scale. 
## Confidence level used: 0.95 
## Note: contrasts are still on the sqrt scale 
## P value adjustment: tukey method for comparing a family of 5 estimates 
## significance level used: alpha = 0.05 
## NOTE: If two or more means share the same grouping symbol,
##       then we cannot show them to be different.
##       But we also did not show them to be the same.

3.2.3 LMM 3. - N_interactions & Probabilité de visite selon la quantité de fleurs

proba d’être visité: +/- fct de la densité: N_int ~ qtté_plantes (par sp. de fleurs)

LM3_qtte <- lmer(N_Interactions ~ Qtte_Plantes + Gestion_moment_5 + Qtte_Plantes:Gestion_moment_5 + Area_gis_m_sq + Temperature + Periode + Periode:Gestion_moment_5 + (1|Parcelle), data = Interactions_Gestion)
# check_model(LM3_qtte)
# shapiro.test(residuals(LM3_qtte))

LM3_qtte <- lmer(sqrt(N_Interactions) ~ Qtte_Plantes + Gestion_moment_5 + Qtte_Plantes:Gestion_moment_5 + Area_gis_m_sq + Temperature + Periode + Periode:Gestion_moment_5 + (1|Parcelle), data = Interactions_Gestion)
# check_model(LM3_qtte)
# shapiro.test(residuals(LM3_qtte))

step(LM3_qtte, direction = "backward")
# sqrt(N_Interactions) ~ Qtte_Plantes + Gestion_moment_5 + Temperature + Periode + (1 | Parcelle) + Qtte_Plantes:Gestion_moment_5 + Gestion_moment_5:Periode
check_model(LM3_qtte)

Anova(LM3_qtte)
## Analysis of Deviance Table (Type II Wald chisquare tests)
## 
## Response: sqrt(N_Interactions)
##                                  Chisq Df Pr(>Chisq)    
## Qtte_Plantes                  270.3715  1  < 2.2e-16 ***
## Gestion_moment_5                4.9530  4   0.292151    
## Area_gis_m_sq                   2.0722  1   0.150008    
## Temperature                    31.3862  1  2.115e-08 ***
## Periode                        29.6885  2  3.575e-07 ***
## Qtte_Plantes:Gestion_moment_5  55.1174  4  3.070e-11 ***
## Gestion_moment_5:Periode       20.2190  8   0.009538 ** 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#summary(LM3_qtte)
#LM3_qtte

eLM3_qtte_P<-emmeans(LM3_qtte,"Periode")
mcLM3_qtte_P<-cld(eLM3_qtte_P,ajust="tukey")
mcLM3_qtte_P$.group<-as.numeric(mcLM3_qtte_P$.group)
mcLM3_qtte_P$group[mcLM3_qtte_P$.group == 1] <- "a"
mcLM3_qtte_P$group[mcLM3_qtte_P$.group == 2] <- "b"
mcLM3_qtte_P
##  Periode     emmean     SE  df lower.CL upper.CL .group group
##  Juin          1.20 0.0776 165     1.05     1.35      1 a    
##  Fin juillet   1.47 0.1001 118     1.27     1.66      2 b    
##  Mi-juillet    1.52 0.0826 196     1.36     1.69      2 b    
## 
## Results are averaged over the levels of: Gestion_moment_5 
## Degrees-of-freedom method: kenward-roger 
## Results are given on the sqrt (not the response) scale. 
## Confidence level used: 0.95 
## Note: contrasts are still on the sqrt scale 
## P value adjustment: tukey method for comparing a family of 3 estimates 
## significance level used: alpha = 0.05 
## NOTE: If two or more means share the same grouping symbol,
##       then we cannot show them to be different.
##       But we also did not show them to be the same.
eLM3_qtte_G5<-emmeans(LM3_qtte,"Gestion_moment_5")
mcLM3_qtte_G5<-cld(eLM3_qtte_G5,ajust="tukey")
mcLM3_qtte_G5$.group<-as.numeric(mcLM3_qtte_G5$.group)
mcLM3_qtte_G5$group[mcLM3_qtte_G5$.group == 1] <- "a"
mcLM3_qtte_G5$group[mcLM3_qtte_G5$.group == 2] <- "b"
mcLM3_qtte_G5$group[mcLM3_qtte_G5$.group == 3] <- "c"
mcLM3_qtte_G5$group[mcLM3_qtte_G5$.group == 12] <- "ab"
mcLM3_qtte_G5$group[mcLM3_qtte_G5$.group == 4] <- "d"
mcLM3_qtte_G5
##  Gestion_moment_5 emmean     SE    df lower.CL upper.CL .group group
##  Fleuri             1.16 0.0804  33.4    0.995     1.32      1 a    
##  Tonte tardive      1.26 0.0649  58.4    1.129     1.39      1 a    
##  Tonte récente      1.36 0.1180 397.1    1.130     1.59      1 a    
##  Semé               1.37 0.1014  25.7    1.159     1.58      1 a    
##  Graminées          1.83 0.3260 136.0    1.189     2.48      1 a    
## 
## Results are averaged over the levels of: Periode 
## Degrees-of-freedom method: kenward-roger 
## Results are given on the sqrt (not the response) scale. 
## Confidence level used: 0.95 
## Note: contrasts are still on the sqrt scale 
## P value adjustment: tukey method for comparing a family of 5 estimates 
## significance level used: alpha = 0.05 
## NOTE: If two or more means share the same grouping symbol,
##       then we cannot show them to be different.
##       But we also did not show them to be the same.
CM3_P_G <- Interactions_Gestion %>% 
  filter(Gestion_moment_5 == "Graminées")
LM3_P_G <- lmer(sqrt(N_Interactions) ~ Qtte_Plantes + Area_gis_m_sq + Temperature + Periode + (1|Parcelle), data = CM3_P_G)
eLM3_P_G<-emmeans(LM3_P_G,"Periode")
mcLM3_P_G<-cld(eLM3_P_G,ajust="tukey")
mcLM3_P_G$.group<-as.numeric(mcLM3_P_G$.group)
mcLM3_P_G$group[mcLM3_P_G$.group == 1] <- "a"
mcLM3_P_G$group[mcLM3_P_G$.group == 2] <- "b"
mcLM3_P_G$group[mcLM3_P_G$.group == 12] <- "ab"
mcLM3_P_G
##  Periode     emmean    SE    df lower.CL upper.CL .group group
##  Juin          0.81 0.178 18.01    0.435     1.18      1 a    
##  Fin juillet   1.23 0.135  8.42    0.919     1.53     12 ab   
##  Mi-juillet    1.25 0.164 15.85    0.908     1.60      2 b    
## 
## Degrees-of-freedom method: kenward-roger 
## Results are given on the sqrt (not the response) scale. 
## Confidence level used: 0.95 
## Note: contrasts are still on the sqrt scale 
## P value adjustment: tukey method for comparing a family of 3 estimates 
## significance level used: alpha = 0.05 
## NOTE: If two or more means share the same grouping symbol,
##       then we cannot show them to be different.
##       But we also did not show them to be the same.
CM3_P_F <- Interactions_Gestion %>% 
  filter(Gestion_moment_5 == "Fleuri")
LM3_P_F <- lmer(sqrt(N_Interactions) ~ Qtte_Plantes + Area_gis_m_sq + Temperature + Periode + (1|Parcelle), data = CM3_P_F)
eLM3_P_F<-emmeans(LM3_P_F,"Periode")
mcLM3_P_F<-cld(eLM3_P_F,ajust="tukey")
mcLM3_P_F$.group<-as.numeric(mcLM3_P_F$.group)
mcLM3_P_F$group[mcLM3_P_F$.group == 1] <- "a"
mcLM3_P_F$group[mcLM3_P_F$.group == 2] <- "b"
mcLM3_P_F$group[mcLM3_P_F$.group == 12] <- "ab"
mcLM3_P_F
##  Periode     emmean     SE   df lower.CL upper.CL .group group
##  Juin          1.03 0.0797 10.7    0.858     1.21      1 a    
##  Fin juillet   1.09 0.0954 20.9    0.890     1.29     12 ab   
##  Mi-juillet    1.22 0.0818 11.7    1.040     1.40      2 b    
## 
## Degrees-of-freedom method: kenward-roger 
## Results are given on the sqrt (not the response) scale. 
## Confidence level used: 0.95 
## Note: contrasts are still on the sqrt scale 
## P value adjustment: tukey method for comparing a family of 3 estimates 
## significance level used: alpha = 0.05 
## NOTE: If two or more means share the same grouping symbol,
##       then we cannot show them to be different.
##       But we also did not show them to be the same.
CM3_P_S <- Interactions_Gestion %>% 
  filter(Gestion_moment_5 == "Semé")
LM3_P_S <- lmer(sqrt(N_Interactions) ~ Qtte_Plantes +  Area_gis_m_sq + Temperature + Periode + (1|Parcelle), data = CM3_P_S)
eLM3_P_S<-emmeans(LM3_P_S,"Periode")
mcLM3_P_S<-cld(eLM3_P_S,ajust="tukey")
mcLM3_P_S$.group<-as.numeric(mcLM3_P_S$.group)
mcLM3_P_S$group[mcLM3_P_S$.group == 1] <- "a"
mcLM3_P_S
##  Periode     emmean     SE    df lower.CL upper.CL .group group
##  Juin          1.22 0.0536 11.89     1.10     1.34      1 a    
##  Fin juillet   1.24 0.0594 16.66     1.11     1.36      1 a    
##  Mi-juillet    1.31 0.0479  7.38     1.20     1.43      1 a    
## 
## Degrees-of-freedom method: kenward-roger 
## Results are given on the sqrt (not the response) scale. 
## Confidence level used: 0.95 
## Note: contrasts are still on the sqrt scale 
## P value adjustment: tukey method for comparing a family of 3 estimates 
## significance level used: alpha = 0.05 
## NOTE: If two or more means share the same grouping symbol,
##       then we cannot show them to be different.
##       But we also did not show them to be the same.
CM3_P_Tr <- Interactions_Gestion %>% 
  filter(Gestion_moment_5 == "Tonte récente")
LM3_P_Tr <- lmer(sqrt(N_Interactions) ~  Qtte_Plantes + Area_gis_m_sq + Temperature + Periode + (1|Parcelle), data = CM3_P_Tr)
eLM3_P_Tr<-emmeans(LM3_P_Tr,"Periode")
mcLM3_P_Tr<-cld(eLM3_P_Tr,ajust="tukey")
mcLM3_P_Tr$.group<-as.numeric(mcLM3_P_Tr$.group)
mcLM3_P_Tr$group[mcLM3_P_Tr$.group == 1] <- "a"
mcLM3_P_Tr
##  Periode     emmean    SE   df lower.CL upper.CL .group group
##  Juin         0.756 0.216 19.7    0.304     1.21      1 a    
##  Mi-juillet   1.076 0.200 28.3    0.666     1.49      1 a    
##  Fin juillet  1.307 0.284 38.3    0.733     1.88      1 a    
## 
## Degrees-of-freedom method: kenward-roger 
## Results are given on the sqrt (not the response) scale. 
## Confidence level used: 0.95 
## Note: contrasts are still on the sqrt scale 
## P value adjustment: tukey method for comparing a family of 3 estimates 
## significance level used: alpha = 0.05 
## NOTE: If two or more means share the same grouping symbol,
##       then we cannot show them to be different.
##       But we also did not show them to be the same.
CM3_P_Tt <- Interactions_Gestion %>% 
  filter(Gestion_moment_5 == "Tonte tardive")
LM3_P_Tt <- lmer(sqrt(N_Interactions) ~  Qtte_Plantes + Area_gis_m_sq + Temperature + Periode + (1|Parcelle), data = CM3_P_Tt)
eLM3_P_Tt<-emmeans(LM3_P_Tt,"Periode")
mcLM3_P_Tt<-cld(eLM3_P_Tt,ajust="tukey")
mcLM3_P_Tt$.group<-as.numeric(mcLM3_P_Tt$.group)
mcLM3_P_Tt$group[mcLM3_P_Tt$.group == 1] <- "a"
mcLM3_P_Tt$group[mcLM3_P_Tt$.group == 2] <- "b"
mcLM3_P_Tt$group[mcLM3_P_Tt$.group == 12] <- "ab"
mcLM3_P_Tt
##  Periode     emmean    SE   df lower.CL upper.CL .group group
##  Juin          1.26 0.112 40.2     1.03     1.49      1 a    
##  Fin juillet   1.50 0.116 68.1     1.27     1.74     12 ab   
##  Mi-juillet    1.75 0.123 50.9     1.51     2.00      2 b    
## 
## Degrees-of-freedom method: kenward-roger 
## Results are given on the sqrt (not the response) scale. 
## Confidence level used: 0.95 
## Note: contrasts are still on the sqrt scale 
## P value adjustment: tukey method for comparing a family of 3 estimates 
## significance level used: alpha = 0.05 
## NOTE: If two or more means share the same grouping symbol,
##       then we cannot show them to be different.
##       But we also did not show them to be the same.
CM3_G5_Ju <- Interactions_Gestion %>% 
  filter(Periode == "Juin")
LM3_G5_Ju <- lmer(sqrt(N_Interactions) ~  Qtte_Plantes + Area_gis_m_sq + Temperature + Gestion_moment_5 + (1|Parcelle), data = CM3_G5_Ju)
eLM3_G5_Ju<-emmeans(LM3_G5_Ju,"Gestion_moment_5")
mcLM3_G5_Ju<-cld(eLM3_G5_Ju,ajust="tukey")
mcLM3_G5_Ju$.group<-as.numeric(mcLM3_G5_Ju$.group)
mcLM3_G5_Ju$group[mcLM3_G5_Ju$.group == 1] <- "a"
mcLM3_G5_Ju$group[mcLM3_G5_Ju$.group == 2] <- "b"
mcLM3_G5_Ju
##  Gestion_moment_5 emmean    SE   df lower.CL upper.CL .group group
##  Graminées         0.909 0.274 38.0    0.353     1.46      1 a    
##  Tonte récente     1.082 0.179 77.9    0.725     1.44      1 a    
##  Fleuri            1.087 0.106 25.8    0.869     1.31      1 a    
##  Tonte tardive     1.216 0.108 40.5    0.998     1.43      1 a    
##  Semé              1.248 0.140 23.0    0.959     1.54      1 a    
## 
## Degrees-of-freedom method: kenward-roger 
## Results are given on the sqrt (not the response) scale. 
## Confidence level used: 0.95 
## Note: contrasts are still on the sqrt scale 
## P value adjustment: tukey method for comparing a family of 5 estimates 
## significance level used: alpha = 0.05 
## NOTE: If two or more means share the same grouping symbol,
##       then we cannot show them to be different.
##       But we also did not show them to be the same.
CM3_G5_mJ <- Interactions_Gestion %>% 
  filter(Periode == "Mi-juillet")
LM3_G5_mJ <-  lmer(sqrt(N_Interactions) ~  Qtte_Plantes + Area_gis_m_sq + Temperature + Gestion_moment_5 + (1|Parcelle), data = CM3_G5_mJ)
eLM3_G5_mJ<-emmeans(LM3_G5_mJ,"Gestion_moment_5")
mcLM3_G5_mJ<-cld(eLM3_G5_mJ,ajust="tukey")
mcLM3_G5_mJ$.group<-as.numeric(mcLM3_G5_mJ$.group)
mcLM3_G5_mJ$group[mcLM3_G5_mJ$.group == 1] <- "a"
mcLM3_G5_mJ$group[mcLM3_G5_mJ$.group == 2] <- "b"
mcLM3_G5_mJ$group[mcLM3_G5_mJ$.group == 3] <- "c"
mcLM3_G5_mJ
##  Gestion_moment_5 emmean    SE    df lower.CL upper.CL .group group
##  Tonte récente      1.02 0.163 166.2    0.701     1.34      1 a    
##  Fleuri             1.30 0.100  22.6    1.097     1.51      1 a    
##  Graminées          1.31 0.241  31.2    0.815     1.80      1 a    
##  Tonte tardive      1.36 0.113  39.4    1.131     1.59      1 a    
##  Semé               1.42 0.118  16.6    1.172     1.67      1 a    
## 
## Degrees-of-freedom method: kenward-roger 
## Results are given on the sqrt (not the response) scale. 
## Confidence level used: 0.95 
## Note: contrasts are still on the sqrt scale 
## P value adjustment: tukey method for comparing a family of 5 estimates 
## significance level used: alpha = 0.05 
## NOTE: If two or more means share the same grouping symbol,
##       then we cannot show them to be different.
##       But we also did not show them to be the same.
CM3_G5_fJ <- Interactions_Gestion %>% 
  filter(Periode == "Fin juillet")
LM3_G5_fJ <-  lmer(sqrt(N_Interactions) ~  Qtte_Plantes + Area_gis_m_sq + Temperature + Gestion_moment_5 + (1|Parcelle), data = CM3_G5_fJ)
eLM3_G5_fJ<-emmeans(LM3_G5_fJ,"Gestion_moment_5")
mcLM3_G5_fJ<-cld(eLM3_G5_fJ,ajust="tukey")
mcLM3_G5_fJ$.group<-as.numeric(mcLM3_G5_fJ$.group)
mcLM3_G5_fJ$group[mcLM3_G5_fJ$.group == 1] <- "a"
mcLM3_G5_fJ$group[mcLM3_G5_fJ$.group == 2] <- "b"
mcLM3_G5_fJ$group[mcLM3_G5_fJ$.group == 12] <- "ab"
mcLM3_G5_fJ
##  Gestion_moment_5 emmean     SE   df lower.CL upper.CL .group group
##  Tonte tardive     0.928 0.0893 47.8    0.748     1.11      1 a    
##  Tonte récente     1.097 0.2219 74.5    0.655     1.54      1 a    
##  Fleuri            1.219 0.1183 22.8    0.975     1.46      1 a    
##  Semé              1.388 0.1244 15.7    1.124     1.65      1 a    
##  Graminées         1.493 0.1883 21.5    1.102     1.88      1 a    
## 
## Degrees-of-freedom method: kenward-roger 
## Results are given on the sqrt (not the response) scale. 
## Confidence level used: 0.95 
## Note: contrasts are still on the sqrt scale 
## P value adjustment: tukey method for comparing a family of 5 estimates 
## significance level used: alpha = 0.05 
## NOTE: If two or more means share the same grouping symbol,
##       then we cannot show them to be different.
##       But we also did not show them to be the same.

3.2.4 LMM 4. - Sum(N_interactions)

Int_glm <- Interactions_Gestion %>% 
  group_by(Site_gestion_date, Periode, Gestion_moment_5, Area_gis_m_sq, Temperature, Parcelle) %>% 
  summarize(n= sum(N_Interactions))

LM4_Int <- lmer(n ~ Area_gis_m_sq + Temperature + Periode * Gestion_moment_5 + (1|Parcelle), data = Int_glm)
# check_model(LM4_Int)
# shapiro.test(residuals(LM4_Int))

LM4_Int <- lmer(sqrt(n) ~ Area_gis_m_sq + Temperature + Periode * Gestion_moment_5 + (1|Parcelle), data = Int_glm)
# check_model(LM4_Int)
# shapiro.test(residuals(LM4_Int))

step(LM4_Int, direction = "backward")
# sqrt(n) ~ Temperature + Periode + Gestion_moment_5 + (1 | Parcelle) + Periode:Gestion_moment_5
check_model(LM4_Int)

Anova(LM4_Int)
## Analysis of Deviance Table (Type II Wald chisquare tests)
## 
## Response: sqrt(n)
##                            Chisq Df Pr(>Chisq)    
## Area_gis_m_sq             2.1736  1   0.140394    
## Temperature               5.0618  1   0.024459 *  
## Periode                   9.7773  2   0.007532 ** 
## Gestion_moment_5         73.7697  4  3.627e-15 ***
## Periode:Gestion_moment_5 16.3526  8   0.037603 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#summary(LM4_Int)
#LM4_Int

eLM4_Int_P<-emmeans(LM4_Int,"Periode")
mcLM4_Int_P<-cld(eLM4_Int_P,ajust="tukey")
mcLM4_Int_P$.group<-as.numeric(mcLM4_Int_P$.group)
mcLM4_Int_P$group[mcLM4_Int_P$.group == 1] <- "a"
mcLM4_Int_P$group[mcLM4_Int_P$.group == 2] <- "b"
mcLM4_Int_P
##  Periode     emmean    SE  df lower.CL upper.CL .group group
##  Fin juillet   4.53 0.510 112     3.52     5.54      1 a    
##  Juin          4.73 0.455 105     3.83     5.63      1 a    
##  Mi-juillet    5.52 0.448 104     4.63     6.41      1 a    
## 
## Results are averaged over the levels of: Gestion_moment_5 
## Degrees-of-freedom method: kenward-roger 
## Results are given on the sqrt (not the response) scale. 
## Confidence level used: 0.95 
## Note: contrasts are still on the sqrt scale 
## P value adjustment: tukey method for comparing a family of 3 estimates 
## significance level used: alpha = 0.05 
## NOTE: If two or more means share the same grouping symbol,
##       then we cannot show them to be different.
##       But we also did not show them to be the same.
CM4_P_G <- Int_glm %>% 
  filter(Gestion_moment_5 == "Graminées")
LM4_P_G <- lmer(sqrt(n) ~ Area_gis_m_sq + Temperature + Periode + (1|Parcelle), data = CM4_P_G)
eLM4_P_G<-emmeans(LM4_P_G,"Periode")
mcLM4_P_G<-cld(eLM4_P_G,ajust="tukey")
mcLM4_P_G$.group<-as.numeric(mcLM4_P_G$.group)
mcLM4_P_G$group[mcLM4_P_G$.group == 1] <- "a"
mcLM4_P_G$group[mcLM4_P_G$.group == 2] <- "b"
mcLM4_P_G
##  Periode     emmean   SE   df lower.CL upper.CL .group group
##  Juin          1.06 1.58 5.85   -2.835     4.95      1 a    
##  Mi-juillet    2.71 1.53 5.87   -1.067     6.48      1 a    
##  Fin juillet   4.91 1.76 5.99    0.589     9.22      1 a    
## 
## Degrees-of-freedom method: kenward-roger 
## Results are given on the sqrt (not the response) scale. 
## Confidence level used: 0.95 
## Note: contrasts are still on the sqrt scale 
## P value adjustment: tukey method for comparing a family of 3 estimates 
## significance level used: alpha = 0.05 
## NOTE: If two or more means share the same grouping symbol,
##       then we cannot show them to be different.
##       But we also did not show them to be the same.
CM4_P_F <- Int_glm %>% 
  filter(Gestion_moment_5 == "Fleuri")
LM4_P_F <- lmer(sqrt(n) ~ Area_gis_m_sq + Temperature + Periode + (1|Parcelle), data = CM4_P_F)
eLM4_P_F<-emmeans(LM4_P_F,"Periode")
mcLM4_P_F<-cld(eLM4_P_F,ajust="tukey")
mcLM4_P_F$.group<-as.numeric(mcLM4_P_F$.group)
mcLM4_P_F$group[mcLM4_P_F$.group == 1] <- "a"
mcLM4_P_F$group[mcLM4_P_F$.group == 2] <- "b"
mcLM4_P_F$group[mcLM4_P_F$.group == 12] <- "ab"
mcLM4_P_F
##  Periode     emmean    SE   df lower.CL upper.CL .group group
##  Fin juillet   4.05 0.889 19.8     2.19     5.90      1 a    
##  Juin          5.91 0.799 16.3     4.21     7.60     12 ab   
##  Mi-juillet    6.30 0.796 16.2     4.62     7.99      2 b    
## 
## Degrees-of-freedom method: kenward-roger 
## Results are given on the sqrt (not the response) scale. 
## Confidence level used: 0.95 
## Note: contrasts are still on the sqrt scale 
## P value adjustment: tukey method for comparing a family of 3 estimates 
## significance level used: alpha = 0.05 
## NOTE: If two or more means share the same grouping symbol,
##       then we cannot show them to be different.
##       But we also did not show them to be the same.
CM4_P_S <- Int_glm %>% 
  filter(Gestion_moment_5 == "Semé")
LM4_P_S <- lmer(sqrt(n) ~ Area_gis_m_sq + Temperature + Periode + (1|Parcelle), data = CM4_P_S)
eLM4_P_S<-emmeans(LM4_P_S,"Periode")
mcLM4_P_S<-cld(eLM4_P_S,ajust="tukey")
mcLM4_P_S$.group<-as.numeric(mcLM4_P_S$.group)
mcLM4_P_S$group[mcLM4_P_S$.group == 1] <- "a"
mcLM4_P_S$group[mcLM4_P_S$.group == 2] <- "b"
mcLM4_P_S$group[mcLM4_P_S$.group == 12] <- "ab"
mcLM4_P_S
##  Periode     emmean    SE   df lower.CL upper.CL .group group
##  Fin juillet   7.39 0.977 8.37     5.16     9.63      1 a    
##  Juin          8.42 0.950 7.91     6.22    10.61      1 a    
##  Mi-juillet   11.30 0.954 7.98     9.10    13.50      2 b    
## 
## Degrees-of-freedom method: kenward-roger 
## Results are given on the sqrt (not the response) scale. 
## Confidence level used: 0.95 
## Note: contrasts are still on the sqrt scale 
## P value adjustment: tukey method for comparing a family of 3 estimates 
## significance level used: alpha = 0.05 
## NOTE: If two or more means share the same grouping symbol,
##       then we cannot show them to be different.
##       But we also did not show them to be the same.
CM4_P_Tr <- Int_glm %>% 
  filter(Gestion_moment_5 == "Tonte récente")
LM4_P_Tr <- lmer(sqrt(n) ~ Area_gis_m_sq + Temperature + Periode + (1|Parcelle), data = CM4_P_Tr)
eLM4_P_Tr<-emmeans(LM4_P_Tr,"Periode")
mcLM4_P_Tr<-cld(eLM4_P_Tr,ajust="tukey")
mcLM4_P_Tr$.group<-as.numeric(mcLM4_P_Tr$.group)
mcLM4_P_Tr$group[mcLM4_P_Tr$.group == 1] <- "a"
mcLM4_P_Tr$group[mcLM4_P_Tr$.group == 2] <- "b"
mcLM4_P_Tr
##  Periode     emmean    SE   df lower.CL upper.CL .group group
##  Mi-juillet    1.26 0.517 21.0    0.179     2.33      1 a    
##  Juin          2.57 0.693 20.9    1.123     4.01      1 a    
##  Fin juillet   2.61 0.934 19.8    0.664     4.56      1 a    
## 
## Degrees-of-freedom method: kenward-roger 
## Results are given on the sqrt (not the response) scale. 
## Confidence level used: 0.95 
## Note: contrasts are still on the sqrt scale 
## P value adjustment: tukey method for comparing a family of 3 estimates 
## significance level used: alpha = 0.05 
## NOTE: If two or more means share the same grouping symbol,
##       then we cannot show them to be different.
##       But we also did not show them to be the same.
CM4_P_Tt <- Int_glm %>% 
  filter(Gestion_moment_5 == "Tonte tardive")
LM4_P_Tt <- lmer(sqrt(n) ~ Area_gis_m_sq + Temperature + Periode + (1|Parcelle), data = CM4_P_Tt)
eLM4_P_Tt<-emmeans(LM4_P_Tt,"Periode")
mcLM4_P_Tt<-cld(eLM4_P_Tt,ajust="tukey")
mcLM4_P_Tt$.group<-as.numeric(mcLM4_P_Tt$.group)
mcLM4_P_Tt$group[mcLM4_P_Tt$.group == 1] <- "a"
mcLM4_P_Tt$group[mcLM4_P_Tt$.group == 2] <- "b"
mcLM4_P_Tt$group[mcLM4_P_Tt$.group == 12] <- "ab"
mcLM4_P_Tt
##  Periode     emmean    SE   df lower.CL upper.CL .group group
##  Fin juillet   3.44 0.700 43.4     2.03     4.85      1 a    
##  Juin          5.72 0.788 43.4     4.13     7.31      1 a    
##  Mi-juillet    6.03 0.892 44.0     4.23     7.83      1 a    
## 
## Degrees-of-freedom method: kenward-roger 
## Results are given on the sqrt (not the response) scale. 
## Confidence level used: 0.95 
## Note: contrasts are still on the sqrt scale 
## P value adjustment: tukey method for comparing a family of 3 estimates 
## significance level used: alpha = 0.05 
## NOTE: If two or more means share the same grouping symbol,
##       then we cannot show them to be different.
##       But we also did not show them to be the same.
eLM4_Int_G5<-emmeans(LM4_Int,"Gestion_moment_5")
mcLM4_Int_G5<-cld(eLM4_Int_G5,ajust="tukey")
mcLM4_Int_G5$.group<-as.numeric(mcLM4_Int_G5$.group)
mcLM4_Int_G5$group[mcLM4_Int_G5$.group == 1] <- "a"
mcLM4_Int_G5$group[mcLM4_Int_G5$.group == 2] <- "b"
mcLM4_Int_G5$group[mcLM4_Int_G5$.group == 3] <- "c"
mcLM4_Int_G5$group[mcLM4_Int_G5$.group == 12] <- "ab"
mcLM4_Int_G5$group[mcLM4_Int_G5$.group == 4] <- "d"
mcLM4_Int_G5
##  Gestion_moment_5 emmean    SE   df lower.CL upper.CL .group group
##  Tonte récente      1.89 0.606 99.0    0.683     3.09      1 a    
##  Graminées          3.02 1.002 42.5    1.003     5.05     12 ab   
##  Tonte tardive      5.02 0.456 60.9    4.112     5.93      2 b    
##  Fleuri             5.40 0.614 43.4    4.163     6.64      2 b    
##  Semé               9.29 0.799 38.1    7.672    10.91      3 c    
## 
## Results are averaged over the levels of: Periode 
## Degrees-of-freedom method: kenward-roger 
## Results are given on the sqrt (not the response) scale. 
## Confidence level used: 0.95 
## Note: contrasts are still on the sqrt scale 
## P value adjustment: tukey method for comparing a family of 5 estimates 
## significance level used: alpha = 0.05 
## NOTE: If two or more means share the same grouping symbol,
##       then we cannot show them to be different.
##       But we also did not show them to be the same.
CM4_G5_Ju <- Int_glm %>% 
  filter(Periode == "Juin")
LM4_G5_Ju <- lm(sqrt(n) ~ Area_gis_m_sq + Temperature + Gestion_moment_5, data = CM4_G5_Ju)
eLM4_G5_Ju<-emmeans(LM4_G5_Ju,"Gestion_moment_5")
mcLM4_G5_Ju<-cld(eLM4_G5_Ju,ajust="tukey")
mcLM4_G5_Ju$.group<-as.numeric(mcLM4_G5_Ju$.group)
mcLM4_G5_Ju$group[mcLM4_G5_Ju$.group == 1] <- "a"
mcLM4_G5_Ju$group[mcLM4_G5_Ju$.group == 2] <- "b"
mcLM4_G5_Ju
##  Gestion_moment_5 emmean    SE df lower.CL upper.CL .group group
##  Graminées          1.28 1.193 39   -1.133     3.69      1 a    
##  Tonte récente      1.96 0.873 39    0.189     3.72      1 a    
##  Tonte tardive      5.64 0.615 39    4.398     6.89      2 b    
##  Fleuri             5.73 0.730 39    4.252     7.21      2 b    
##  Semé               8.26 0.987 39    6.260    10.25      2 b    
## 
## Results are given on the sqrt (not the response) scale. 
## Confidence level used: 0.95 
## Note: contrasts are still on the sqrt scale 
## P value adjustment: tukey method for comparing a family of 5 estimates 
## significance level used: alpha = 0.05 
## NOTE: If two or more means share the same grouping symbol,
##       then we cannot show them to be different.
##       But we also did not show them to be the same.
CM4_G5_mJ <- Int_glm %>% 
  filter(Periode == "Mi-juillet")
LM4_G5_mJ <- lm(sqrt(n) ~ Area_gis_m_sq + Temperature + Gestion_moment_5, data = CM4_G5_mJ)
eLM4_G5_mJ<-emmeans(LM4_G5_mJ,"Gestion_moment_5")
mcLM4_G5_mJ<-cld(eLM4_G5_mJ,ajust="tukey")
mcLM4_G5_mJ$.group<-as.numeric(mcLM4_G5_mJ$.group)
mcLM4_G5_mJ$group[mcLM4_G5_mJ$.group == 1] <- "a"
mcLM4_G5_mJ$group[mcLM4_G5_mJ$.group == 2] <- "b"
mcLM4_G5_mJ$group[mcLM4_G5_mJ$.group == 3] <- "c"
mcLM4_G5_mJ
##  Gestion_moment_5 emmean    SE df lower.CL upper.CL .group group
##  Tonte récente      1.28 0.731 39   -0.196     2.76      1 a    
##  Graminées          1.71 1.352 39   -1.026     4.44      1 a    
##  Fleuri             6.46 0.815 39    4.812     8.11      2 b    
##  Tonte tardive      6.55 0.783 39    4.966     8.13      2 b    
##  Semé              11.29 1.090 39    9.088    13.50      3 c    
## 
## Results are given on the sqrt (not the response) scale. 
## Confidence level used: 0.95 
## Note: contrasts are still on the sqrt scale 
## P value adjustment: tukey method for comparing a family of 5 estimates 
## significance level used: alpha = 0.05 
## NOTE: If two or more means share the same grouping symbol,
##       then we cannot show them to be different.
##       But we also did not show them to be the same.
CM4_G5_fJ <- Int_glm %>% 
  filter(Periode == "Fin juillet")
LM4_G5_fJ <- lm(sqrt(n) ~ Area_gis_m_sq + Temperature + Gestion_moment_5, data = CM4_G5_fJ)
eLM4_G5_fJ<-emmeans(LM4_G5_fJ,"Gestion_moment_5")
mcLM4_G5_fJ<-cld(eLM4_G5_fJ,ajust="tukey")
mcLM4_G5_fJ$.group<-as.numeric(mcLM4_G5_fJ$.group)
mcLM4_G5_fJ$group[mcLM4_G5_fJ$.group == 1] <- "a"
mcLM4_G5_fJ$group[mcLM4_G5_fJ$.group == 2] <- "b"
mcLM4_G5_fJ$group[mcLM4_G5_fJ$.group == 12] <- "ab"
mcLM4_G5_fJ
##  Gestion_moment_5 emmean    SE df lower.CL upper.CL .group group
##  Tonte récente      1.82 1.247 35    -0.71     4.35      1 a    
##  Tonte tardive      3.40 0.615 35     2.15     4.65      1 a    
##  Fleuri             4.08 0.977 35     2.10     6.07     12 ab   
##  Graminées          5.69 1.576 35     2.49     8.89     12 ab   
##  Semé               8.30 1.155 35     5.95    10.64      2 b    
## 
## Results are given on the sqrt (not the response) scale. 
## Confidence level used: 0.95 
## Note: contrasts are still on the sqrt scale 
## P value adjustment: tukey method for comparing a family of 5 estimates 
## significance level used: alpha = 0.05 
## NOTE: If two or more means share the same grouping symbol,
##       then we cannot show them to be different.
##       But we also did not show them to be the same.

3.2.5 LMM 5. Nombre de visites par unité florale par heure - nvis/fl.h

nvis./fl. h: Q où sp présente dans les 3 Q, sp phare, comparer période/gestion

Interactions_Gestion %>% 
  count(Sp_Pollinisateurs) %>% 
  arrange(desc(n))
##                                Sp_Pollinisateurs   n
## 1                                 Apis mellifera 419
## 2                                                318
## 3                             Lasioglossum spec. 149
## 4                               Bombus pascuorum 110
## 5                                  Hylaeus spec. 103
## 6                              Bombus lapidarius 101
## 7                                  Syrphus spec.  87
## 8                           Episyrphus balteatus  73
## 9                              Anthophila indet.  71
## 10                               Syritta pipiens  49
## 11                               Eristalis tenax  39
## 12                     Bombus vestalis/bohemicus  36
## 13                              Syrphidae indet.  35
## 14                           Sphaerophoria spec.  34
## 15                         Sphaerophoria scripta  31
## 16    Bombus terrestris/lucorum/magnus/cryptarum  25
## 17                            Heriades truncorum  25
## 18                        Platycheirus albimanus  23
## 19                               Maniola jurtina  22
## 20                            Halictus scabiosae  21
## 21                             Eupeodes corollae  19
## 22           Lasioglossum (Leuchalictus) - spec.  17
## 23                            Polyommatus icarus  17
## 24                              Andrena flavipes  16
## 25              Lasioglossum (Dialictus) - spec.  15
## 26                               Eristalis spec.  14
## 27                               Megachile spec.  14
## 28                             Eristalis nemorum  12
## 29                            Eristalis pertinax  11
## 30                               Syrphus ribesii  11
## 31                                 Andrena rosae   9
## 32                                 Andrena spec.   9
## 33                               Sphecodes spec.   8
## 34                               Cheilosia spec.   7
## 35                               Andrena fulvago   6
## 36                           Helophilus pendulus   6
## 37                         Osmia leaiana/niveata   6
## 38                                Aricia agestis   4
## 39                               Bombus pratorum   4
## 40                          Eristalis arbustorum   4
## 41                              Myathropa florea   4
## 42                                  Pieris spec.   4
## 43                                Bombus lucorum   3
## 44                               Ceratina cyanea   3
## 45                          Chelostoma rapunculi   3
## 46                             Dasypoda hirtipes   3
## 47                              Eupeodes luniger   3
## 48         Lasioglossum (Sphecodogastra) - spec.   3
## 49                          Melanostoma mellinum   3
## 50 Melanostoma mellinum - Platycheirus albimanus   3
## 51                               Andrena humilis   2
## 52                             Cerceris arenaria   2
## 53                            Cerceris rybyensis   2
## 54                                Cerceris spec.   2
## 55           Colletes daviesanus/fodiens/similis   2
## 56                             Euclidia glyphica   2
## 57                             Halictidae indet.   2
## 58                        Helophilus trivittatus   2
## 59                       Megachile centuncularis   2
## 60                           Panurgus calcaratus   2
## 61                              Pyronia tithonus   2
## 62                                     Aglais io   1
## 63                               Andrena dorsata   1
## 64                          Andrena minutula-gr.   1
## 65                               Andrena proxima   1
## 66                                  Bombus spec.   1
## 67                               Bombus vestalis   1
## 68                            Carcharodus alceae   1
## 69                              Cheilosia pagana   1
## 70                          Cheilosia variabilis   1
## 71                      Dasysyrphus albostriatus   1
## 72                  Eristalis arbustorum/abusiva   1
## 73                        Eupeodes latifasciatus   1
## 74                              Hylaeus communis   1
## 75                              Hylaeus gredleri   1
## 76                      Lasioglossum leucozonium   1
## 77                       Lasioglossum sexnotatum   1
## 78                               Lycaena phlaeas   1
## 79                      Macroglossum stellatarum   1
## 80                       Megachile willughbiella   1
## 81                             Melanostoma spec.   1
## 82                          Mesembrina meridiana   1
## 83                                Neoascia spec.   1
## 84                                Nowickia ferox   1
## 85                               Osmia spinulosa   1
## 86                           Paragus haemorrhous   1
## 87                                   Pieris napi   1
## 88                                  Pieris rapae   1
## 89                               Pipizella spec.   1
## 90                             Pipizella viduata   1
## 91                               Scaeva pyrastri   1
## 92                             Scaeva selenitica   1
## 93                                  Scaeva spec.   1
## 94                        Stelis punctulatissima   1
## 95                             Stomorhina lunata   1
Interactions_nvis_fl_h <- Interactions_Gestion %>% 
  filter(Sp_Pollinisateurs == "Apis mellifera"|
         Sp_Pollinisateurs == "Bombus pascuorum"|
         Sp_Pollinisateurs == "Bombus lapidarius"|
         Sp_Pollinisateurs == "Lasioglossum spec."|
         Sp_Pollinisateurs == "Hylaeus spec."|
         Sp_Pollinisateurs == "Episyrphus balteatus")

Q1 <- Interactions_nvis_fl_h %>% 
  filter(Nombre_quadrats == "1") %>% 
  mutate(nvis_fl_h = N_Interactions/(Qtte_Plantes/2))

Q2 <- Interactions_nvis_fl_h %>% 
  filter(Nombre_quadrats == "2") %>% 
  mutate(nvis_fl_h = N_Interactions/(Qtte_Plantes/4))

Q3 <- Interactions_nvis_fl_h %>% 
  filter(Nombre_quadrats == "3") %>%
  mutate(nvis_fl_h = N_Interactions/(Qtte_Plantes/6))

Interactions_nvis_fl_h <- full_join(Q1, Q2)
Interactions_nvis_fl_h <- full_join(Interactions_nvis_fl_h, Q3)
  

Interactions_nvis_fl_h %>% ggplot(aes (x = Sp_Pollinisateurs, y = nvis_fl_h, color = Gestion_moment_5)) + 
  geom_boxplot(alpha = 0.70) +
  scale_color_manual(values = c("Graminées" = "#fbcb09",
                                  "Fleuri" = "#ff7207",
                                  "Semé" = "#de1e21",
                                  "Tonte récente" = "#6abe1d",
                                  "Tonte tardive" = "#2b790c")) + 
  labs(#title = "", 
    x = "Sp_poll", y = "nvis_fl_h") +
   theme(legend.position = "bottom") +

Interactions_nvis_fl_h %>% ggplot(aes (x = Sp_Pollinisateurs, y = nvis_fl_h, color = Periode)) + 
  geom_boxplot(alpha = 0.70) +
     scale_color_manual(values = c(Juin = "#74a9cf",
                                 `Mi-juillet` = "#2b8cbe",
                                 `Fin juillet` = "#045a8d")) + 
  labs(#title = "", 
    x = "Sp_poll", y = "nvis_fl_h") +
   theme(legend.position = "bottom")

LM5_nvis <- lmer(nvis_fl_h ~ Area_gis_m_sq + Temperature + Periode * Gestion_moment_5 + Sp_Pollinisateurs + (1|Parcelle), data = Interactions_nvis_fl_h)
# check_model(LM5_nvis)
# shapiro.test(residuals(LM5_nvis))

LM5_nvis <- lmer(log(nvis_fl_h) ~ Area_gis_m_sq + Temperature + Periode * Gestion_moment_5 + Sp_Pollinisateurs + (1|Parcelle), data = Interactions_nvis_fl_h)
# check_model(LM5_nvis)
# shapiro.test(residuals(LM5_nvis))

step(LM5_nvis, direction = "backward")
# log(nvis_fl_h) ~ log(nvis_fl_h) ~ Temperature + Periode + Gestion_moment_5 + Sp_Pollinisateurs + (1 | Parcelle) + Periode:Gestion_moment_5
check_model(LM5_nvis)

Anova(LM5_nvis)
## Analysis of Deviance Table (Type II Wald chisquare tests)
## 
## Response: log(nvis_fl_h)
##                            Chisq Df Pr(>Chisq)    
## Area_gis_m_sq             0.5189  1   0.471318    
## Temperature              24.5067  1  7.405e-07 ***
## Periode                  16.7118  2   0.000235 ***
## Gestion_moment_5         56.4344  4  1.626e-11 ***
## Sp_Pollinisateurs        15.0319  5   0.010227 *  
## Periode:Gestion_moment_5 19.4051  8   0.012837 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#summary(LM5_nvis)
#LM5_nvis

eLM5_nvis_P<-emmeans(LM5_nvis,"Periode")
mcLM5_nvis_P<-cld(eLM5_nvis_P,ajust="tukey")
mcLM5_nvis_P$.group<-as.numeric(mcLM5_nvis_P$.group)
mcLM5_nvis_P$group[mcLM5_nvis_P$.group == 1] <- "a"
mcLM5_nvis_P$group[mcLM5_nvis_P$.group == 2] <- "b"
mcLM5_nvis_P
##  Periode     emmean    SE  df lower.CL upper.CL .group group
##  Juin        -1.501 0.161 178    -1.82   -1.182      1 a    
##  Mi-juillet  -1.021 0.141 124    -1.30   -0.742      2 b    
##  Fin juillet -0.899 0.145 126    -1.19   -0.611      2 b    
## 
## Results are averaged over the levels of: Gestion_moment_5, Sp_Pollinisateurs 
## Degrees-of-freedom method: kenward-roger 
## Results are given on the log (not the response) scale. 
## Confidence level used: 0.95 
## P value adjustment: tukey method for comparing a family of 3 estimates 
## significance level used: alpha = 0.05 
## NOTE: If two or more means share the same grouping symbol,
##       then we cannot show them to be different.
##       But we also did not show them to be the same.
CM5_P_G <- Interactions_nvis_fl_h %>% 
  filter(Gestion_moment_5 == "Graminées")
LM5_P_G <- lmer(log(nvis_fl_h) ~ Area_gis_m_sq + Temperature + Periode +  Sp_Pollinisateurs + (1|Parcelle), data = CM5_P_G)
eLM5_P_G<-emmeans(LM5_P_G,"Periode")
mcLM5_P_G<-cld(eLM5_P_G,ajust="tukey")
mcLM5_P_G$.group<-as.numeric(mcLM5_P_G$.group)
mcLM5_P_G$group[mcLM5_P_G$.group == 1] <- "a"
mcLM5_P_G$group[mcLM5_P_G$.group == 2] <- "b"
mcLM5_P_G$group[mcLM5_P_G$.group == 12] <- "ab"
mcLM5_P_G
##  Periode     emmean    SE   df lower.CL upper.CL .group group
##  Juin        -3.274 1.316 78.1    -5.89   -0.654     12 ab   
##  Mi-juillet  -2.069 0.583 36.6    -3.25   -0.888      1 a    
##  Fin juillet -0.028 0.635 27.9    -1.33    1.273      2 b    
## 
## Results are averaged over the levels of: Sp_Pollinisateurs 
## Degrees-of-freedom method: kenward-roger 
## Results are given on the log (not the response) scale. 
## Confidence level used: 0.95 
## P value adjustment: tukey method for comparing a family of 3 estimates 
## significance level used: alpha = 0.05 
## NOTE: If two or more means share the same grouping symbol,
##       then we cannot show them to be different.
##       But we also did not show them to be the same.
CM5_P_F <- Interactions_nvis_fl_h %>% 
  filter(Gestion_moment_5 == "Fleuri")
LM5_P_F <- lmer(log(nvis_fl_h) ~ Area_gis_m_sq + Temperature + Periode + Sp_Pollinisateurs + (1|Parcelle), data = CM5_P_F)
eLM5_P_F<-emmeans(LM5_P_F,"Periode")
mcLM5_P_F<-cld(eLM5_P_F,ajust="tukey")
mcLM5_P_F$.group<-as.numeric(mcLM5_P_F$.group)
mcLM5_P_F$group[mcLM5_P_F$.group == 1] <- "a"
mcLM5_P_F$group[mcLM5_P_F$.group == 2] <- "b"
mcLM5_P_F$group[mcLM5_P_F$.group == 12] <- "ab"
mcLM5_P_F
##  Periode     emmean    SE   df lower.CL upper.CL .group group
##  Juin        -0.954 0.145 19.5    -1.26   -0.651      1 a    
##  Mi-juillet  -0.774 0.148 20.4    -1.08   -0.466      1 a    
##  Fin juillet -0.622 0.228 69.3    -1.08   -0.166      1 a    
## 
## Results are averaged over the levels of: Sp_Pollinisateurs 
## Degrees-of-freedom method: kenward-roger 
## Results are given on the log (not the response) scale. 
## Confidence level used: 0.95 
## P value adjustment: tukey method for comparing a family of 3 estimates 
## significance level used: alpha = 0.05 
## NOTE: If two or more means share the same grouping symbol,
##       then we cannot show them to be different.
##       But we also did not show them to be the same.
CM5_P_S <- Interactions_nvis_fl_h %>% 
  filter(Gestion_moment_5 == "Semé")
LM5_P_S <- lmer(log(nvis_fl_h) ~ Area_gis_m_sq + Temperature + Periode + Sp_Pollinisateurs + (1|Parcelle), data = CM5_P_S)
eLM5_P_S<-emmeans(LM5_P_S,"Periode")
mcLM5_P_S<-cld(eLM5_P_S,ajust="tukey")
mcLM5_P_S$.group<-as.numeric(mcLM5_P_S$.group)
mcLM5_P_S$group[mcLM5_P_S$.group == 1] <- "a"
mcLM5_P_S$group[mcLM5_P_S$.group == 2] <- "b"
mcLM5_P_S$group[mcLM5_P_S$.group == 12] <- "ab"
mcLM5_P_S
##  Periode     emmean    SE   df lower.CL upper.CL .group group
##  Mi-juillet  -0.273 0.149 5.27   -0.651    0.106      1 a    
##  Juin        -0.154 0.159 6.66   -0.534    0.227      1 a    
##  Fin juillet -0.128 0.175 9.56   -0.521    0.265      1 a    
## 
## Results are averaged over the levels of: Sp_Pollinisateurs 
## Degrees-of-freedom method: kenward-roger 
## Results are given on the log (not the response) scale. 
## Confidence level used: 0.95 
## P value adjustment: tukey method for comparing a family of 3 estimates 
## significance level used: alpha = 0.05 
## NOTE: If two or more means share the same grouping symbol,
##       then we cannot show them to be different.
##       But we also did not show them to be the same.
CM5_P_Tr <- Interactions_nvis_fl_h %>% 
  filter(Gestion_moment_5 == "Tonte récente")
LM5_P_Tr <- lmer(log(nvis_fl_h) ~ Area_gis_m_sq + Temperature + Periode + Sp_Pollinisateurs + (1|Parcelle), data = CM5_P_Tr)
eLM5_P_Tr<-emmeans(LM5_P_Tr,"Periode")
mcLM5_P_Tr<-cld(eLM5_P_Tr,ajust="tukey")
mcLM5_P_Tr$.group<-as.numeric(mcLM5_P_Tr$.group)
mcLM5_P_Tr$group[mcLM5_P_Tr$.group == 1] <- "a"
mcLM5_P_Tr$group[mcLM5_P_Tr$.group == 2] <- "b"
mcLM5_P_Tr$group[mcLM5_P_Tr$.group == 12] <- "ab"
mcLM5_P_Tr
##  Periode     emmean    SE    df lower.CL upper.CL .group group
##  Juin         -2.42 0.308 10.90    -3.10   -1.745      1 a    
##  Fin juillet  -1.57 0.449  5.92    -2.67   -0.466      1 a    
##  Mi-juillet   -1.34 0.365 12.72    -2.13   -0.545      1 a    
## 
## Results are averaged over the levels of: Sp_Pollinisateurs 
## Degrees-of-freedom method: kenward-roger 
## Results are given on the log (not the response) scale. 
## Confidence level used: 0.95 
## P value adjustment: tukey method for comparing a family of 3 estimates 
## significance level used: alpha = 0.05 
## NOTE: If two or more means share the same grouping symbol,
##       then we cannot show them to be different.
##       But we also did not show them to be the same.
CM5_P_Tt <- Interactions_nvis_fl_h %>% 
  filter(Gestion_moment_5 == "Tonte tardive")
LM5_P_Tt <- lmer(log(nvis_fl_h) ~ Area_gis_m_sq + Temperature + Periode + Sp_Pollinisateurs + (1|Parcelle), data = CM5_P_Tt)
eLM5_P_Tt<-emmeans(LM5_P_Tt,"Periode")
mcLM5_P_Tt<-cld(eLM5_P_Tt,ajust="tukey")
mcLM5_P_Tt$.group<-as.numeric(mcLM5_P_Tt$.group)
mcLM5_P_Tt$group[mcLM5_P_Tt$.group == 1] <- "a"
mcLM5_P_Tt$group[mcLM5_P_Tt$.group == 2] <- "b"
mcLM5_P_Tt$group[mcLM5_P_Tt$.group == 12] <- "ab"
mcLM5_P_Tt
##  Periode     emmean    SE   df lower.CL upper.CL .group group
##  Juin         -2.24 0.171 49.7    -2.58   -1.894      1 a    
##  Mi-juillet   -1.47 0.178 57.6    -1.83   -1.116      2 b    
##  Fin juillet  -1.28 0.175 74.9    -1.62   -0.927      2 b    
## 
## Results are averaged over the levels of: Sp_Pollinisateurs 
## Degrees-of-freedom method: kenward-roger 
## Results are given on the log (not the response) scale. 
## Confidence level used: 0.95 
## P value adjustment: tukey method for comparing a family of 3 estimates 
## significance level used: alpha = 0.05 
## NOTE: If two or more means share the same grouping symbol,
##       then we cannot show them to be different.
##       But we also did not show them to be the same.
eLM5_nvis_G5<-emmeans(LM5_nvis,"Gestion_moment_5")
mcLM5_nvis_G5<-cld(eLM5_nvis_G5,ajust="tukey")
mcLM5_nvis_G5$.group<-as.numeric(mcLM5_nvis_G5$.group)
mcLM5_nvis_G5$group[mcLM5_nvis_G5$.group == 1] <- "a"
mcLM5_nvis_G5$group[mcLM5_nvis_G5$.group == 12] <- "ab"
mcLM5_nvis_G5$group[mcLM5_nvis_G5$.group == 23] <- "bc"
mcLM5_nvis_G5$group[mcLM5_nvis_G5$.group == 3] <- "c"
mcLM5_nvis_G5
##  Gestion_moment_5 emmean    SE    df lower.CL upper.CL .group group
##  Tonte tardive    -1.803 0.126  56.6   -2.056   -1.549      1 a    
##  Graminées        -1.542 0.395  60.7   -2.331   -0.752     12 ab   
##  Tonte récente    -1.408 0.217 251.4   -1.835   -0.980     12 ab   
##  Fleuri           -0.751 0.161  36.1   -1.077   -0.426     23 bc   
##  Semé             -0.198 0.196  24.7   -0.601    0.206      3 c    
## 
## Results are averaged over the levels of: Periode, Sp_Pollinisateurs 
## Degrees-of-freedom method: kenward-roger 
## Results are given on the log (not the response) scale. 
## Confidence level used: 0.95 
## P value adjustment: tukey method for comparing a family of 5 estimates 
## significance level used: alpha = 0.05 
## NOTE: If two or more means share the same grouping symbol,
##       then we cannot show them to be different.
##       But we also did not show them to be the same.
CM5_G5_Ju <- Interactions_nvis_fl_h %>% 
  filter(Periode == "Juin")
LM5_G5_Ju <- lmer(log(nvis_fl_h) ~ Area_gis_m_sq + Temperature + Gestion_moment_5 + Sp_Pollinisateurs + (1|Parcelle), data = CM5_G5_Ju)
eLM5_G5_Ju<-emmeans(LM5_G5_Ju,"Gestion_moment_5")
mcLM5_G5_Ju<-cld(eLM5_G5_Ju,ajust="tukey")
mcLM5_G5_Ju$.group<-as.numeric(mcLM5_G5_Ju$.group)
mcLM5_G5_Ju$group[mcLM5_G5_Ju$.group == 1] <- "a"
mcLM5_G5_Ju$group[mcLM5_G5_Ju$.group == 2] <- "b"
mcLM5_G5_Ju$group[mcLM5_G5_Ju$.group == 12] <- "ab"
mcLM5_G5_Ju
##  Gestion_moment_5 emmean    SE   df lower.CL upper.CL .group group
##  Tonte récente     -2.19 0.458 76.2    -3.10  -1.2737      1 a    
##  Tonte tardive     -1.99 0.265 35.4    -2.52  -1.4496      1 a    
##  Graminées         -1.85 0.930 38.1    -3.74   0.0287     12 ab   
##  Fleuri            -1.08 0.260 27.4    -1.62  -0.5477     12 ab   
##  Semé              -0.37 0.333 22.4    -1.06   0.3202      2 b    
## 
## Results are averaged over the levels of: Sp_Pollinisateurs 
## Degrees-of-freedom method: kenward-roger 
## Results are given on the log (not the response) scale. 
## Confidence level used: 0.95 
## P value adjustment: tukey method for comparing a family of 5 estimates 
## significance level used: alpha = 0.05 
## NOTE: If two or more means share the same grouping symbol,
##       then we cannot show them to be different.
##       But we also did not show them to be the same.
CM5_G5_mJ <- Interactions_nvis_fl_h %>% 
  filter(Periode == "Mi-juillet")
LM5_G5_mJ <- lmer(log(nvis_fl_h) ~ Area_gis_m_sq + Temperature + Gestion_moment_5 + Sp_Pollinisateurs + (1|Parcelle), data = CM5_G5_mJ)
eLM5_G5_mJ<-emmeans(LM5_G5_mJ,"Gestion_moment_5")
mcLM5_G5_mJ<-cld(eLM5_G5_mJ,ajust="tukey")
mcLM5_G5_mJ$.group<-as.numeric(mcLM5_G5_mJ$.group)
mcLM5_G5_mJ$group[mcLM5_G5_mJ$.group == 1] <- "a"
mcLM5_G5_mJ$group[mcLM5_G5_mJ$.group == 2] <- "b"
mcLM5_G5_mJ$group[mcLM5_G5_mJ$.group == 12] <- "ab"
mcLM5_G5_mJ
##  Gestion_moment_5 emmean    SE   df lower.CL upper.CL .group group
##  Tonte tardive    -1.852 0.237 41.3   -2.331   -1.373      1 a    
##  Graminées        -1.374 0.570 41.5   -2.525   -0.223     12 ab   
##  Tonte récente    -1.027 0.374 77.9   -1.773   -0.282     12 ab   
##  Fleuri           -0.656 0.234 36.6   -1.129   -0.182      2 b    
##  Semé             -0.424 0.268 25.5   -0.976    0.127      2 b    
## 
## Results are averaged over the levels of: Sp_Pollinisateurs 
## Degrees-of-freedom method: kenward-roger 
## Results are given on the log (not the response) scale. 
## Confidence level used: 0.95 
## P value adjustment: tukey method for comparing a family of 5 estimates 
## significance level used: alpha = 0.05 
## NOTE: If two or more means share the same grouping symbol,
##       then we cannot show them to be different.
##       But we also did not show them to be the same.
CM5_G5_fJ <- Interactions_nvis_fl_h %>% 
  filter(Periode == "Fin juillet")
LM5_G5_fJ <- lmer(log(nvis_fl_h) ~ Area_gis_m_sq + Temperature + Gestion_moment_5 + Sp_Pollinisateurs + (1|Parcelle), data = CM5_G5_fJ)
eLM5_G5_fJ<-emmeans(LM5_G5_fJ,"Gestion_moment_5")
mcLM5_G5_fJ<-cld(eLM5_G5_fJ,ajust="tukey")
mcLM5_G5_fJ$.group<-as.numeric(mcLM5_G5_fJ$.group)
mcLM5_G5_fJ$group[mcLM5_G5_fJ$.group == 1] <- "a"
mcLM5_G5_fJ$group[mcLM5_G5_fJ$.group == 2] <- "b"
mcLM5_G5_fJ$group[mcLM5_G5_fJ$.group == 12] <- "ab"
mcLM5_G5_fJ$group[mcLM5_G5_fJ$.group == 23] <- "bc"
mcLM5_G5_fJ$group[mcLM5_G5_fJ$.group == 3] <- "c"
mcLM5_G5_fJ$group[mcLM5_G5_fJ$.group == 123] <- "abc"
mcLM5_G5_fJ
##  Gestion_moment_5 emmean    SE   df lower.CL upper.CL .group group
##  Tonte récente    -1.904 0.441 38.8   -2.797   -1.011     12 ab   
##  Tonte tardive    -1.834 0.229 44.6   -2.295   -1.374      1 a    
##  Graminées        -0.703 0.563 31.0   -1.852    0.446    123 abc  
##  Fleuri           -0.457 0.302 29.3   -1.075    0.161     23 bc   
##  Semé             -0.179 0.313 16.9   -0.841    0.482      3 c    
## 
## Results are averaged over the levels of: Sp_Pollinisateurs 
## Degrees-of-freedom method: kenward-roger 
## Results are given on the log (not the response) scale. 
## Confidence level used: 0.95 
## P value adjustment: tukey method for comparing a family of 5 estimates 
## significance level used: alpha = 0.05 
## NOTE: If two or more means share the same grouping symbol,
##       then we cannot show them to be different.
##       But we also did not show them to be the same.
eLM5_nvis_spP<-emmeans(LM5_nvis,"Sp_Pollinisateurs")
mcLM5_nvis_spP<-cld(eLM5_nvis_spP,ajust="tukey")
mcLM5_nvis_spP$.group<-as.numeric(mcLM5_nvis_spP$.group)
mcLM5_nvis_spP$group[mcLM5_nvis_spP$.group == 1] <- "a"
mcLM5_nvis_spP$group[mcLM5_nvis_spP$.group == 2] <- "b"
mcLM5_nvis_spP$group[mcLM5_nvis_spP$.group == 12] <- "ab"
mcLM5_nvis_spP
##  Sp_Pollinisateurs    emmean    SE    df lower.CL upper.CL .group group
##  Apis mellifera        -1.38 0.120  74.3    -1.62   -1.142      1 a    
##  Bombus lapidarius     -1.21 0.150 165.0    -1.51   -0.918     12 ab   
##  Bombus pascuorum      -1.20 0.153 171.1    -1.50   -0.893     12 ab   
##  Hylaeus spec.         -1.08 0.167 221.2    -1.41   -0.751     12 ab   
##  Episyrphus balteatus  -1.02 0.176 273.0    -1.37   -0.674     12 ab   
##  Lasioglossum spec.    -0.95 0.137 128.3    -1.22   -0.679      2 b    
## 
## Results are averaged over the levels of: Periode, Gestion_moment_5 
## Degrees-of-freedom method: kenward-roger 
## Results are given on the log (not the response) scale. 
## Confidence level used: 0.95 
## P value adjustment: tukey method for comparing a family of 6 estimates 
## significance level used: alpha = 0.05 
## NOTE: If two or more means share the same grouping symbol,
##       then we cannot show them to be different.
##       But we also did not show them to be the same.

3.2.6 LMM 6. Tonte

3.2.6.1 S

LM6_Tonte_S <- lmer(S ~ Jour_af_tonte + (1|Site), data = expe_Tonte)
# check_model(LM6_Tonte_S)
# shapiro.test(residuals(LM6_Tonte_S))

LM6_Tonte_S <- lmer((S)^2 ~ Jour_af_tonte + (1|Site), data = expe_Tonte)
# check_model(LM6_Tonte_S)
# shapiro.test(residuals(LM6_Tonte_S))

step(LM6_Tonte_S, direction = "backward")
# (S)^2 ~ Jour_af_tonte
check_model(LM6_Tonte_S)

Anova(LM6_Tonte_S)
## Analysis of Deviance Table (Type II Wald chisquare tests)
## 
## Response: (S)^2
##                Chisq Df Pr(>Chisq)    
## Jour_af_tonte 23.293  1  1.391e-06 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#summary(LM6_Tonte_S)
#LM6_Tonte_S

3.2.6.2 Ab

LM6_Tonte_Ab <- lmer(Ab ~ Jour_af_tonte + (1|Site), data = expe_Tonte)
# check_model(LM6_Tonte_Ab)
# shapiro.test(residuals(LM6_Tonte_Ab))
LM6_Tonte_Ab <- lmer(sqrt(Ab) ~ Jour_af_tonte + (1|Site), data = expe_Tonte)

step(LM6_Tonte_Ab, direction = "backward")
# sqrt(Ab) ~ Jour_af_tonte + (1 | Site)
check_model(LM6_Tonte_Ab)

Anova(LM6_Tonte_Ab)
## Analysis of Deviance Table (Type II Wald chisquare tests)
## 
## Response: sqrt(Ab)
##                Chisq Df Pr(>Chisq)    
## Jour_af_tonte 114.88  1  < 2.2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#summary(LM6_Tonte_Ab)
#LM6_Tonte_Ab

4 Autres analyses

4.1 Interactions vs pas d’interactions: tests d’homogénéité

Interactions_Gestion$Inter_YN <- ifelse(Interactions_Gestion$N_Interactions == 0, 0, 1)
Interactions_Gestion %>% 
  group_by(Gestion_2, Inter_YN) %>% 
  mutate(Inter_YN = as.factor(Inter_YN)) %>% 
  summarize(n = n()) %>% 
  ggplot(aes(x = Inter_YN, y = n, color = Gestion_2)) +
  geom_point(size = 3)

Interactions_Gestion %>% 
  group_by(Gestion_moment_5, Inter_YN) %>% 
  mutate(Inter_YN = as.factor(Inter_YN)) %>% 
  summarize(n = n()) %>% 
  ggplot(aes(x = Inter_YN, y = n, color = Gestion_moment_5)) +
  geom_jitter(size = 3, width = 0.15) +
    scale_color_manual(values = c("Graminées" = "#fbcb09",
                                  "Fleuri" = "#ff7207",
                                  "Semé" = "#de1e21",
                                  "Tonte récente" = "#6abe1d",
                                  "Tonte tardive" = "#2b790c")) 

a <- Interactions_Gestion %>% 
  group_by(Gestion_moment_5) %>%  
  summarize(a = n())

b <- Interactions_Gestion %>% 
  group_by(Gestion_moment_5, Inter_YN) %>% 
  mutate(Inter_YN = as.factor(Inter_YN)) %>% 
  summarize(n = n()) 
c <- full_join(a,b)

c %>% 
  mutate(prop = n/a) %>% 
  filter(Inter_YN == 1) %>% 
  ggplot(aes(x = Gestion_moment_5, y = prop, color = Gestion_moment_5)) +
  geom_point(size = 3) +
    scale_color_manual(values = c("Graminées" = "#fbcb09",
                                  "Fleuri" = "#ff7207",
                                  "Semé" = "#de1e21",
                                  "Tonte récente" = "#6abe1d",
                                  "Tonte tardive" = "#2b790c")) 

Interactions_Gestion <- Interactions_Gestion %>% 
  mutate(Inter_YN = as.factor(Inter_YN))
levels(Interactions_Gestion$Inter_YN) <- c("Pas d'interactions","Interactions")

Interactions_Gestion %>% 
  group_by(Gestion_moment_5, Inter_YN) %>% 
  mutate(Inter_YN = as.factor(Inter_YN)) %>% 
  summarize(n = n()) %>% 
  ggplot(aes(x = Gestion_moment_5, y = n, color = Inter_YN)) +
  geom_jitter(size = 3, width = 0.15) 

Interactions_Gestion %>% 
  group_by(Gestion_moment_5, Inter_YN) %>% 
  mutate(Inter_YN = as.factor(Inter_YN)) %>%
  summarize(n = n()) %>% 
  ggplot(aes(x = Gestion_moment_5, y = n, color = Gestion_moment_5)) +
  facet_wrap(~Inter_YN) +
  geom_boxplot(alpha = 0.70) +
    scale_color_manual(values = c("Graminées" = "#fbcb09",
                                  "Fleuri" = "#ff7207",
                                  "Semé" = "#de1e21",
                                  "Tonte récente" = "#6abe1d",
                                  "Tonte tardive" = "#2b790c")) 

4.2 Espèces de plantes ayant zero interactions

Totalité des quadrats

Pl_zero <- Interactions_Gestion %>% 
  replace(is.na(.), 0) %>% 
  group_by(Sp_Plantes) %>% 
  summarise(data = sum(N_Interactions)) %>% 
  filter(data == 0)
Pl_zero 
## # A tibble: 17 × 2
##    Sp_Plantes                data
##    <chr>                    <int>
##  1 ""                           0
##  2 "Cerastium fontanum"         0
##  3 "Galium mollugo"             0
##  4 "Geranium dissectum"         0
##  5 "Geranium molle"             0
##  6 "Lapsana communis"           0
##  7 "Lathyrus latifolius"        0
##  8 "Plantago lanceolata"        0
##  9 "Ranunculus acris"           0
## 10 "Rhinanthus minor"           0
## 11 "Tanacetum vulgare"          0
## 12 "Trifolium campestre"        0
## 13 "Trifolium dubium"           0
## 14 "Veronica arvensis"          0
## 15 "Veronica persica"           0
## 16 "Veronica serpyllifolia"     0
## 17 "Vicia sativa"               0

16 espèces de plantes non-visitées, dans aucun quadrat!

4.3 Nombre de changements de fleurs/sp

pour sp de poll. x individus : +ieurs fleurs en séquences

Interactions_indiv <-  Interactions_Classes %>% 
  filter(!is.na(individu)) %>% 
  mutate(Sp_pollinisateurs = Sp_Pollinisateurs) %>% 
  unite('Sp_unique', Sp_Pollinisateurs:individu)

seq <- Interactions_indiv %>% 
  count(Sp_unique) %>% 
  arrange(desc(n))
indiv_seq <- full_join(Interactions_indiv,seq)
sum <- Interactions_indiv %>% 
  group_by(Sp_unique) %>% 
  summarize(sum = sum(N_Interactions)) %>% 
  arrange(desc(sum))
join_sum <- full_join(Interactions_indiv, sum)
join_sum_n <- full_join(join_sum, indiv_seq)


join_sum_n %>% 
  ggplot(aes(x= Classe_Poll, y= sum, color = Gestion_2))+
  geom_boxplot(alpha = 0.70)

join_sum_n %>% 
  ggplot(aes(x= Sp_pollinisateurs, y= sum, color = Gestion_2))+
  geom_point()

join_sum_n %>% 
  mutate(n = as.factor(n)) %>% 
  ggplot(aes(x= Sp_pollinisateurs, y= sum, color = n))+
  geom_point()

join_sum_n %>% 
  mutate(n = as.factor(n)) %>% 
  ggplot(aes(x= Classe_Poll, y= sum, color = n))+
  geom_boxplot(alpha = 0.70)

join_sum_n %>% ggplot(aes(x= Sp_pollinisateurs, y= n, color = Classe_Poll))+
  geom_point()

join_sum_n %>% ggplot(aes(x= Classe_Poll, y= n, color = Gestion_2))+
  geom_point(size = 4)

Interactions_Gestion %>% 
  select(Site_gestion_date_Quadrat, Gestion_moment_5, Sp_Plantes, Sp_Pollinisateurs, individu, N_Interactions) %>% 
  filter(individu == "1315"|
           individu == "1434"|
           individu == "1325"|
           individu == "749"|
           individu == "536"|
           individu == "1202"|
           individu == "755")
##       Site_gestion_date_Quadrat Gestion_moment_5           Sp_Plantes
## 1      CAV_Fauche_finJuillet_Q1             Semé      Centaurea jacea
## 2      CAV_Fauche_finJuillet_Q1             Semé   Trifolium pratense
## 3      CAV_Fauche_finJuillet_Q1             Semé     Knautia arvensis
## 4      CAV_Fauche_finJuillet_Q2             Semé Betonica officinalis
## 5      CAV_Fauche_finJuillet_Q2             Semé    Prunella vulgaris
## 6      CAV_Fauche_finJuillet_Q2             Semé      Centaurea jacea
## 7       CAV_Fauche_miJuillet_Q2             Semé      Centaurea jacea
## 8       CAV_Fauche_miJuillet_Q2             Semé Betonica officinalis
## 9       CAV_Fauche_miJuillet_Q2             Semé Betonica officinalis
## 10      CAV_Fauche_miJuillet_Q2             Semé    Prunella vulgaris
## 11      CAV_Fauche_miJuillet_Q2             Semé    Prunella vulgaris
## 12      CAV_Fauche_miJuillet_Q2             Semé   Trifolium pratense
## 13       Kellner_Fauche_Juin_Q3             Semé Achillea millefolium
## 14       Kellner_Fauche_Juin_Q3             Semé    Jacobaea vulgaris
## 15       Kellner_Fauche_Juin_Q3             Semé     Origanum vulgare
## 16  Kellner_Fauche_miJuillet_Q1             Semé Hypericum perforatum
## 17  Kellner_Fauche_miJuillet_Q1             Semé    Jacobaea vulgaris
## 18  Kellner_Fauche_miJuillet_Q1             Semé   Lotus corniculatus
## 19 Reaumur_Fauche_finJuillet_Q1             Semé    Cichorium intybus
## 20 Reaumur_Fauche_finJuillet_Q1             Semé      Cirsium arvense
## 21 Reaumur_Fauche_finJuillet_Q1             Semé      Centaurea jacea
##      Sp_Pollinisateurs individu N_Interactions
## 1     Bombus pascuorum     1315              1
## 2     Bombus pascuorum     1315              1
## 3     Bombus pascuorum     1315              2
## 4     Bombus pascuorum     1325              1
## 5     Bombus pascuorum     1325              4
## 6     Bombus pascuorum     1325              1
## 7     Bombus pascuorum      749              2
## 8     Bombus pascuorum      749              1
## 9     Bombus pascuorum      755              9
## 10    Bombus pascuorum      749              3
## 11    Bombus pascuorum      755              3
## 12    Bombus pascuorum      755              3
## 13 Helophilus pendulus      536              1
## 14 Helophilus pendulus      536              1
## 15 Helophilus pendulus      536              1
## 16     Megachile spec.     1202              1
## 17     Megachile spec.     1202              3
## 18     Megachile spec.     1202              1
## 19   Bombus lapidarius     1434              1
## 20   Bombus lapidarius     1434              2
## 21   Bombus lapidarius     1434              2
length(unique(Interactions_indiv$Sp_Plantes))
## [1] 33

5 Graphiques finaux

5.1 Heure

ggplot(Inv) +
  aes(x = Heure_debut, y = Ab_Poll, color = Gestion_moment_5) +
  geom_point()+ 
  scale_color_manual(values = c("Graminées" = "#fbcb09",
                                "Fleuri" = "#ff7207",
                                "Semé" = "#de1e21",
                                "Tonte récente" = "#6abe1d",
                                "Tonte tardive" = "#2b790c")) + 
  scale_x_discrete(breaks = c("09:00:00","10:00:00","11:00:00","12:00:00","13:00:00","14:00:00","15:00:00","16:00:00", "17:00:00")) +
  labs(x = "Heure", 
       y = "Abondance en pollinisateurs", 
       color = "Type de gestion") +
  theme(legend.position="bottom",
        legend.title = element_text(size= 12),
        legend.text = element_text(size=10),
        axis.text=element_text(size=12),
        axis.title=element_text(size=14))

5.2 Meteo

ggplot(Inv) +
  aes(x = Gestion_moment_5, y = Ab_Poll, color = Meteo) +
  geom_boxplot(alpha = 0.70) +
  scale_color_manual(values = c("Nuageux" = "#7f908c",
                                "Alternances" = "#79ccbd",
                                "Soleil" = "#fbcb09")) +
  labs(x = "Type de gestion", 
       y = "Abondance en pollinisateurs", 
       color = "Météo") +
  theme(legend.position="bottom",
        legend.title = element_text(size= 12),
        legend.text = element_text(size=10),
        axis.text=element_text(size=12),
        axis.title=element_text(size=14))

5.3 Courbes d’accumulation

5.3.1 Plantes

ggplot(data=accum.long_Plantes_G2, aes(x = Sites, y = Richness, ymax = UPR, ymin = LWR)) + 
    scale_x_continuous(sec.axis = dup_axis(labels=NULL, name=NULL)) +
    scale_y_continuous(sec.axis = dup_axis(labels=NULL, name=NULL)) +
    geom_line(aes(colour=Grouping), size=1.5) +
    geom_point(data=subset(accum.long_Plantes_G2, labelit==TRUE), 
               aes(colour=Grouping, shape=Grouping), size=2.5) +
      scale_shape_manual(values = c("Fauche" = 16,
                                  "Tonte" = 5)) +
    geom_ribbon(aes(colour=Grouping, fill=after_scale(alpha(colour, alpha=0.15))), 
                show.legend=FALSE) + 
    scale_color_manual(values = c("Fauche" = "#aa1e0f",
                                "Tonte" = "#12661f")) +
    labs(x = "Nombre d'échantillonages", y = "Nombre d'espèces de plantes", colour = "Type de gestion", shape = "Type de gestion") + 
  theme(legend.position = c(0.85,0.07),
        legend.text = element_text(size=10),
        axis.text=element_text(size=12),
        axis.title=element_text(size=14)) +
ggplot(data=accum.long_Plantes_G5, aes(x = Sites, y = Richness, ymax = UPR, ymin = LWR)) + 
  scale_x_continuous(sec.axis = dup_axis(labels=NULL, name=NULL)) +
  scale_y_continuous(sec.axis = dup_axis(labels=NULL, name=NULL)) +
  geom_line(aes(colour=Grouping), size=1.5) +
  geom_point(data=subset(accum.long_Plantes_G5, labelit==T), 
             aes(colour=Grouping, shape=Grouping), size=2.5) +
  scale_shape_manual(values = c("Graminées" = 16,
                                "Fleuri" = 17,
                                "Semé" = 15,
                                "Tonte récente" = 5,
                                "Tonte tardive" = 6)) +
  geom_ribbon(aes(colour=Grouping, fill=after_scale(alpha(colour, alpha=0.15))), 
              show.legend=FALSE) + 
  scale_color_manual(values = c("Graminées" = "#fbcb09",
                                "Fleuri" = "#ff7207",
                                "Semé" = "#de1e21",
                                "Tonte récente" = "#6abe1d",
                                "Tonte tardive" = "#2b790c")) + 
  labs(x = "Nombre d'échantillonages", y = "Nombre d'espèces de plantes", colour = "Type de gestion", shape = "Type de gestion") +
  theme(legend.position = c(0.82,0.12),
        legend.text = element_text(size=10),
        axis.text=element_text(size=12),
        axis.title=element_text(size=14))  

5.3.2 Pollinisateurs

ggplot(data=accum.long_Poll_G2, aes(x = Sites, y = Richness, ymax = UPR, ymin = LWR)) + 
  scale_x_continuous(sec.axis = dup_axis(labels=NULL, name=NULL)) +
  scale_y_continuous(sec.axis = dup_axis(labels=NULL, name=NULL)) +
  geom_line(aes(colour=Grouping), size=1.5) +
  geom_point(data=subset(accum.long_Poll_G2, labelit==TRUE), 
             aes(colour=Grouping, shape=Grouping), size=2.5) +
  scale_shape_manual(values = c("Fauche" = 16,
                                "Tonte" = 5)) +
  geom_ribbon(aes(colour=Grouping, fill=after_scale(alpha(colour, alpha=0.15))), 
              show.legend=FALSE) + 
  scale_color_manual(values = c("Fauche" = "#aa1e0f",
                                "Tonte" = "#12661f")) +
  labs(x = "Nombre d'échantillonages", y = "Nombre d'espèces de pollinisateurs", colour = "Type de gestion", shape = "Type de gestion") + 
    theme(legend.position = c(0.85,0.07),
        legend.text = element_text(size=10),
        axis.text=element_text(size=12),
        axis.title=element_text(size=14)) +
ggplot(data=accum.long_Poll_G5, aes(x = Sites, y = Richness, ymax = UPR, ymin = LWR)) + 
  scale_x_continuous(sec.axis = dup_axis(labels=NULL, name=NULL)) +
  scale_y_continuous(sec.axis = dup_axis(labels=NULL, name=NULL)) +
  geom_line(aes(colour=Grouping), size=1.5) +
  geom_point(data=subset(accum.long_Poll_G5, labelit==T), 
             aes(colour=Grouping, shape=Grouping), size=2.5) +
  scale_shape_manual(values = c("Graminées" = 16,
                                "Fleuri" = 17,
                                "Semé" = 15,
                                "Tonte récente" = 5,
                                "Tonte tardive" = 6)) + 
  geom_ribbon(aes(colour=Grouping, fill=after_scale(alpha(colour, alpha=0.15))), 
              show.legend=FALSE) + 
  scale_color_manual(values = c("Graminées" = "#fbcb09",
                                "Fleuri" = "#ff7207",
                                "Semé" = "#de1e21",
                                "Tonte récente" = "#6abe1d",
                                "Tonte tardive" = "#2b790c")) + 
  labs(x = "Nombre d'échantillonages", y = "Nombre d'espèces de pollinisateurs", colour = "Type de gestion", shape = "Type de gestion") +
  theme(legend.position = c(0.82,0.12),
        legend.text = element_text(size=10),
        axis.text=element_text(size=12),
        axis.title=element_text(size=14))  

5.4 Analyses multivariées

Voir précédement

5.5 Modèles Inventaires

5.5.1 LM1_S_Pl

Inv %>% ggplot(aes (x = Gestion_2, y = S_Plant)) + 
  geom_boxplot(aes (color = Gestion_2), alpha = 0.70) + 
  scale_color_manual(values = c("Fauche" = "#aa1e0f",
                                "Tonte" = "#12661f")) +
  labs(#title = "Richesse spécifique en plantes en fonction des types de gestion", 
    x = "Type de gestion", y = "Richesse spécifique en plantes") +
  theme(legend.position = "none",
        axis.text=element_text(size=12),
        axis.title=element_text(size=14)) +
  geom_text(aes(label = "b", y = 14, x = 1),color="black") +
  geom_text(aes(label = "a", y = 7, x = 2),color="black")

5.5.2 LM1_Ab_Pl

Inv %>% ggplot(aes (x = Periode, y = Ab_Plant)) + 
  geom_boxplot(aes (color = Periode), alpha = 0.70) + 
  scale_color_manual(values = c(Juin = "#74a9cf",
                                `Mi-juillet` = "#2b8cbe",
                                `Fin juillet` = "#045a8d")) + 
  labs(#title = "Abondance en plantes en fonction des types de gestion", 
    x = "Période", y = "Abondance en plantes") +
  theme(legend.position = "none",
        axis.text=element_text(size=12),
        axis.title=element_text(size=14)) +
  geom_text(aes(label = "b", y = 265, x =1),color="black") +
  geom_text(aes(label = "a", y = 210, x =2),color="black") +
  geom_text(aes(label = "a", y = 160, x =3),color="black") +
Inv %>% ggplot(aes (x = Temperature, y = Ab_Plant)) + 
  geom_point() +
  geom_smooth(method = "lm", se = T) +
  labs(#title = "Richesse spécifique en pollinisateurs en fonction des types de gestion", 
    x = "Température (°C)", y = "Abondance en plantes") + 
  theme(axis.text=element_text(size=12),
        axis.title=element_text(size=14))

5.5.3 LM1_S_Po

Inv %>% ggplot(aes (x = Gestion_2, y = S_Poll)) + 
  geom_boxplot(aes (color = Gestion_2), alpha = 0.70) + 
  scale_color_manual(values = c("Fauche" = "#aa1e0f",
                                "Tonte" = "#12661f")) +
  labs(#title = "Richesse spécifique en pollinisateurs en fonction des types de gestion", 
    x = "Type de gestion", y = "Richesse spécifique en pollinisateurs") +
  theme(legend.position = "none",
        axis.text=element_text(size=12),
        axis.title=element_text(size=14)) +
  geom_text(aes(label = "b", y = 21.5, x =1),color="black") +
  geom_text(aes(label = "a", y = 10, x =2),color="black")

5.5.4 LM1_Ab_Po

Inv %>% ggplot(aes (x = Gestion_2, y = Ab_Poll)) + 
  geom_boxplot(aes (color = Gestion_2), alpha = 0.70) + 
  scale_color_manual(values = c("Fauche" = "#aa1e0f",
                                "Tonte" = "#12661f")) +
  labs(#title = "Abondance en pollinisateurs en fonction des types de gestion", 
    x = "Type de gestion", y = "Abondance en pollinisateurs") +
  theme(legend.position = "none",
        axis.text=element_text(size=12),
        axis.title=element_text(size=14)) +
         geom_text(aes(label = "b", y = 55, x =1),color="black") +
  geom_text(aes(label = "a", y = 19, x =2),color="black")

5.5.5 LM2_S_Pl

Inv %>% ggplot(aes (x = Periode, y = S_Plant)) +
  geom_boxplot(aes (color = Periode), alpha = 0.70) +
  scale_color_manual(values = c(Juin = "#74a9cf",
                                `Mi-juillet` = "#2b8cbe",
                                `Fin juillet` = "#045a8d")) +
  labs(#title = "Abondance de plantes en fonction des types de gestion",
    x = "Période", y = "Richesse spécifique en plantes", color = "Période") +
  theme(legend.position = "none",
        axis.text=element_text(size=12),
        axis.title=element_text(size=14)) +
  geom_text(aes(label = "a", y = 11.5, x =1),color="black") +
  geom_text(aes(label = "a", y = 9.5, x =2),color="black") +
  geom_text(aes(label = "a", y = 7.5, x =3),color="black") +
Inv %>% ggplot(aes (x = Gestion_moment_5, y = S_Plant)) + 
   geom_boxplot(aes (color = Gestion_moment_5), alpha = 0.70) + 
  scale_color_manual(values = c("Graminées" = "#fbcb09",
                                "Fleuri" = "#ff7207",
                                "Semé" = "#de1e21",
                                "Tonte récente" = "#6abe1d",#6dcf20
                                "Tonte tardive" = "#2b790c")) + #12661f
  labs(#title = "Richesse spécifique en plantes en fonction des types de gestion", 
    x = "Type de gestion", y = "Richesse spécifique en plantes") +
  theme(legend.position = "none",
        axis.text=element_text(size=10),
        axis.title=element_text(size=14)) +
  geom_text(aes(label = "a", y = 6, x =1),color="black") +
  geom_text(aes(label = "a", y = 5, x =4),color="black") +
  geom_text(aes(label = "b", y = 7, x =5),color="black") +
  geom_text(aes(label = "bc", y = 12, x =2),color="black") +
  geom_text(aes(label = "c", y = 18, x =3),color="black") 

5.5.6 LM2_Ab_Pl

Inv %>% ggplot(aes (x = Periode, y = Ab_Plant)) + 
  geom_boxplot(aes (color = Periode), alpha = 0.70) + 
  scale_color_manual(values = c(Juin = "#74a9cf",
                                `Mi-juillet` = "#2b8cbe",
                                `Fin juillet` = "#045a8d")) +
  labs(#title = "Abondance de plantes en fonction des types de gestion", 
    x = "Période", y = "Abondance en plantes", color = "Période") +
  theme(legend.position = "none",
        axis.text=element_text(size=12),
        axis.title=element_text(size=14)) +
    geom_text(aes(label = "b", y = 265, x =1),color="black") +
  geom_text(aes(label = "a", y = 210, x =2),color="black") +
  geom_text(aes(label = "a", y = 160, x =3),color="black") +
  Inv %>% ggplot(aes (x = Gestion_moment_5, y = Ab_Plant)) + 
  geom_boxplot(aes (color = Gestion_moment_5), alpha = 0.70) + 
  scale_color_manual(values = c("Graminées" = "#fbcb09",
                                "Fleuri" = "#ff7207",
                                "Semé" = "#de1e21",
                                "Tonte récente" = "#6abe1d",
                                "Tonte tardive" = "#2b790c")) + 
  labs(#title = "Abondance de plantes en fonction des types de gestion", 
    x = "Type de gestion", y = "Abondance en plantes", color = "Type de gestion") +
  theme(legend.position = "none",
        axis.text=element_text(size=10),
        axis.title=element_text(size=14)) +
      geom_text(aes(label = "a", y = 60, x =1),color="black") +
  geom_text(aes(label = "b", y = 270, x =2),color="black") +
  geom_text(aes(label = "b", y = 270, x =3),color="black") +
      geom_text(aes(label = "a", y = 110, x =4),color="black") +
  geom_text(aes(label = "b", y = 210, x =5),color="black") 

5.5.7 LM2_S_Po

Inv %>% ggplot(aes (x = Periode, y = S_Poll)) + 
  geom_boxplot(aes (color = Periode), alpha = 0.70) + 
  scale_color_manual(values = c(Juin = "#74a9cf",
                                `Mi-juillet` = "#2b8cbe",
                                `Fin juillet` = "#045a8d")) +
  labs(x = "Période", y = "Richesse spécifique en pollinisateurs", color = "Type de gestion") +
  theme(legend.position = "none",
        axis.text=element_text(size=10),
        axis.title=element_text(size=14)) +
    geom_text(aes(label = "a", y = 16.5, x = 1)) +
  geom_text(aes(label = "a", y = 19.5, x = 2)) +
  geom_text(aes(label = "a", y = 16.5, x = 3)) +
Inv %>% ggplot(aes (x = Gestion_moment_5, y = S_Poll)) + 
  geom_boxplot(aes (color = Gestion_moment_5), alpha = 0.70) + 
  scale_color_manual(values = c("Graminées" = "#fbcb09",
                                "Fleuri" = "#ff7207",
                                "Semé" = "#de1e21",
                                "Tonte récente" = "#6abe1d",
                                "Tonte tardive" = "#2b790c")) + 
  labs(x = "Type de gestion", y = "Richesse spécifique en pollinisateurs", color = "Type de gestion") +
  theme(legend.position = "none",
        axis.text=element_text(size=10),
        axis.title=element_text(size=14)) +
    geom_text(aes(label = "ab", y = 12.5, x = 1)) +
  geom_text(aes(label = "c", y = 17.5, x = 2)) +
  geom_text(aes(label = "c", y = 21.5, x = 3)) +
  geom_text(aes(label = "a", y = 5.5, x = 4)) +
  geom_text(aes(label = "b", y = 9.5, x = 5))

data_text <- data.frame(label = c("a", "b", "b","a", "a", 
                                  "ab", "cd", "d","a", "bc",
                                  "b", "b", "b","a", "a"),
                        Periode = rep(c("Juin", "Mi-juillet", "Fin juillet"), each = 5),
                        x = c(1,2,3,4,5,
                              1,2,3,4,5,
                              1,2,3,4,5),
                        y = c(9,14,17,6,10,
                              10,18,20,5,6,
                              13,10,11,3,6))
data_text$Periode <- fct_relevel(data_text$Periode, c("Juin", "Mi-juillet", "Fin juillet"))
Inv %>% ggplot(aes (x = Gestion_moment_5, y = S_Poll)) + 
  facet_wrap(~Periode)+
  geom_boxplot(aes (color = Gestion_moment_5), alpha = 0.70) + 
  scale_color_manual(values = c("Graminées" = "#fbcb09",
                                "Fleuri" = "#ff7207",
                                "Semé" = "#de1e21",
                                "Tonte récente" = "#6abe1d",
                                "Tonte tardive" = "#2b790c")) + 
  labs(x = "Type de gestion", y = "Richesse spécifique en pollinisateurs") +
  theme(legend.position = "none",
        #axis.title.x=element_blank(),
        legend.title = element_text(size=11), 
        legend.text = element_text(size=10),
        axis.text.y = element_text(size=10),
        axis.text.x = element_text(size=8),
        axis.title = element_text(size=14),
        strip.text = element_text(size=10)) +
   geom_text(data = data_text %>% filter(Periode == Periode), 
             mapping = aes(x = x, y = y, label = label),
             size = 4, fontface = "bold")

5.5.8 LM2_Ab_Po

Inv %>% ggplot(aes (x = Periode, y = Ab_Poll)) + 
  geom_boxplot(aes (color = Periode), alpha = 0.70) + 
  scale_color_manual(values = c(Juin = "#74a9cf",
                                `Mi-juillet` = "#2b8cbe",
                                `Fin juillet` = "#045a8d")) +
  labs(x = "Période", y = "Abondance en pollinisateurs", color = "Type de gestion") +
  theme(legend.position = "none",
        axis.text=element_text(size=10),
        axis.title=element_text(size=14)) +
    geom_text(aes(label = "a", y = 42.5, x = 1)) +
  geom_text(aes(label = "a", y = 45, x = 2)) +
  geom_text(aes(label = "a", y = 29, x = 3)) +
Inv %>% ggplot(aes (x = Gestion_moment_5, y = Ab_Poll)) + 
  geom_boxplot(aes (color = Gestion_moment_5), alpha = 0.70) + 
  scale_color_manual(values = c("Graminées" = "#fbcb09",
                                "Fleuri" = "#ff7207",
                                "Semé" = "#de1e21",
                                "Tonte récente" = "#6abe1d",
                                "Tonte tardive" = "#2b790c")) + 
  labs(x = "Type de gestion", y = "Abondance en pollinisateurs", color = "Type de gestion") +
  theme(legend.position = "none",
        axis.text=element_text(size=10),
        axis.title=element_text(size=14)) +
    geom_text(aes(label = "ab", y = 17.5, x = 1)) +
  geom_text(aes(label = "c", y = 45, x = 2)) +
  geom_text(aes(label = "d", y = 62, x = 3)) +
  geom_text(aes(label = "a", y = 9, x = 4)) +
  geom_text(aes(label = "b", y = 19, x = 5))

data_text <- data.frame(label = c("ab", "c", "c","a", "b", 
                                  "ab", "c", "d","a", "bc",
                                  "b", "ab", "b","a", "a"),
                        Periode = rep(c("Juin", "Mi-juillet", "Fin juillet"), each = 5),
                        x = c(1,2,3,4,5,
                              1,2,3,4,5,
                              1,2,3,4,5),
                        y = c(16,40,43,9,29,
                              19,45,63,6,20,
                              45,25,40,6,19))
data_text$Periode <- fct_relevel(data_text$Periode, c("Juin", "Mi-juillet", "Fin juillet"))
Inv %>% ggplot(aes (x = Gestion_moment_5, y = Ab_Poll)) + 
  facet_wrap(~Periode)+
  geom_boxplot(aes (color = Gestion_moment_5), alpha = 0.70) + 
  scale_color_manual(values = c("Graminées" = "#fbcb09",
                                "Fleuri" = "#ff7207",
                                "Semé" = "#de1e21",
                                "Tonte récente" = "#6abe1d",
                                "Tonte tardive" = "#2b790c")) + 
  labs(x = "Type de gestion", y = "Abondance en pollinisateurs", color = "Type de gestion") +
  theme(legend.position = "none",
        legend.title = element_text(size=11), 
        legend.text = element_text(size=10),
        axis.text.y = element_text(size=10),
        axis.text.x = element_text(size=8),
        axis.title = element_text(size=14),
        strip.text = element_text(size=10)) +
   geom_text(data = data_text %>% filter(Periode == Periode), 
             mapping = aes(x = x, y = y, label = label),
             size = 4, fontface = "bold")

5.6 Modèles Interactions

5.6.1 LM3_Int : N_Int & qtté fleurs

Interactions_Gestion %>% ggplot(aes (x = Qtte_Plantes, y = N_Interactions)) + 
  geom_point() +
  geom_smooth(method = "lm") +
  theme(legend.position = "none",
        axis.text=element_text(size=10),
        axis.title=element_text(size=14)) +
  labs(x = "Quantité d'unités florales", y = "Nombre d'interactions") +
Interactions_Gestion %>% ggplot(aes (x = Temperature, y = N_Interactions)) + 
  geom_point() +
  geom_smooth(method = "lm") +
  theme(legend.position = "none",
        axis.text=element_text(size=10),
        axis.title=element_text(size=14)) +
  labs(x = "Température (°C)", y = "Nombre d'interactions") +
Interactions_Gestion %>% ggplot(aes (x = Periode, y = N_Interactions)) + 
  geom_boxplot(aes (color = Periode), alpha = 0.70) +
  scale_color_manual(values = c(Juin = "#74a9cf",
                                `Mi-juillet` = "#2b8cbe",
                                `Fin juillet` = "#045a8d")) + 
  theme(legend.position = "none",
        axis.text=element_text(size=10),
        axis.title=element_text(size=14)) +
    geom_text(aes(label = "a", y = 25, x = 1)) +
  geom_text(aes(label = "b", y = 26.5, x = 2)) +
  geom_text(aes(label = "b", y = 28, x = 3)) +
    labs(x = "Période", y = "Nombre d'interactions")

Interactions_Gestion %>% ggplot(aes (x = Qtte_Plantes, y = N_Interactions)) + 
  geom_point(aes (color = Gestion_moment_5)) + 
  geom_smooth(aes (color = Gestion_moment_5), method = "lm", se = T) +
    scale_color_manual(values = c("Graminées" = "#fbcb09",
                                  "Fleuri" = "#ff7207",
                                  "Semé" = "#de1e21",
                                  "Tonte récente" = "#6abe1d",
                                  "Tonte tardive" = "#2b790c")) + 
  theme(legend.position = "bottom",
        axis.text=element_text(size=10),
        axis.title=element_text(size=14)) +
    labs(x = "Quantité d'unités florales", y = "Nombre d'interactions", color = "Type de gestion")

data_text <- data.frame(label = c("a", "b", "ab", 
                                  "a", "b", "ab",
                                  "a", "a", "a",
                                  "a", "a", "a",
                                  "a", "b", "ab"),
                        Gestion_moment_5 = rep(c("Graminées", "Fleuri", "Semé", "Tonte récente", "Tonte tardive"), each = 3),
                        x = c(1,2,3,
                              1,2,3,
                              1,2,3,
                              1,2,3,
                              1,2,3),
                        y = c(8,8,8,
                              10,18,7,
                              11,13,14,
                              4,11,9,
                              25,27,28))
data_text$Gestion_moment_5 <- fct_relevel(data_text$Gestion_moment_5, c("Graminées", "Fleuri", "Semé", "Tonte récente", "Tonte tardive"))
Interactions_Gestion %>% ggplot(aes (x = Periode, y = N_Interactions)) +
  facet_wrap(~Gestion_moment_5) +
 geom_boxplot(aes (color = Periode), alpha = 0.70) +
  scale_color_manual(values = c(Juin = "#74a9cf",
                                `Mi-juillet` = "#2b8cbe",
                                `Fin juillet` = "#045a8d")) + 
  labs(x = "Période", y = "Nombre d'interactions", color = "Type de gestion") +
  theme(legend.position = "none",
        legend.title = element_text(size=11), 
        legend.text = element_text(size=10),
        axis.text.y = element_text(size=10),
        axis.text.x = element_text(size=8),
        axis.title = element_text(size=14),
        strip.text = element_text(size=10)) +
   geom_text(data = data_text %>% filter(Gestion_moment_5 == Gestion_moment_5), 
            mapping = aes(x = x, y = y, label = label),
            size = 4, fontface = "bold")

5.6.2 LM4_Int : sum(N_Int)

Température: voir LM3

Interactions_Gestion %>% 
  group_by(Site_gestion_date, Periode, Gestion_moment_5, Temperature) %>% 
  summarize(n= sum(N_Interactions)) %>% 
  ggplot(aes (x = Temperature, y = n)) + 
  geom_point() +
  geom_smooth(method = "lm") +
  labs(x = "Température (°C)", y="Somme des interactions") +
  theme(axis.text=element_text(size=10),
        axis.title=element_text(size=14))

Interactions_Gestion %>% 
  group_by(Site_gestion_date, Periode, Gestion_moment_5) %>% 
  summarize(n= sum(N_Interactions)) %>% 
  ggplot(aes (x = Periode, y = n)) + 
  geom_boxplot(aes (color = Periode), alpha = 0.70) + 
  scale_color_manual(values = c(Juin = "#74a9cf",
                                `Mi-juillet` = "#2b8cbe",
                                `Fin juillet` = "#045a8d")) +
  labs(x = "Période", y = "Somme des interactions", color = "Type de gestion") +
  theme(legend.position = "none",
        axis.text=element_text(size=10),
        axis.title=element_text(size=14)) +
    geom_text(aes(label = "a", y = 137, x = 1)) +
  geom_text(aes(label = "a", y = 155, x = 2)) +
  geom_text(aes(label = "a", y = 75, x = 3)) +
Interactions_Gestion %>% 
  group_by(Site_gestion_date, Periode, Gestion_moment_5) %>% 
  summarize(n= sum(N_Interactions)) %>% 
  ggplot(aes (x = Gestion_moment_5, y = n)) + 
  geom_boxplot(aes (color = Gestion_moment_5), alpha = 0.70) + 
  scale_color_manual(values = c("Graminées" = "#fbcb09",
                                "Fleuri" = "#ff7207",
                                "Semé" = "#de1e21",
                                "Tonte récente" = "#6abe1d",
                                "Tonte tardive" = "#2b790c")) + 
  labs(x = "Type de gestion", y = "Somme des interactions", color = "Type de gestion") +
  theme(legend.position = "none",
        axis.text=element_text(size=10),
        axis.title=element_text(size=14)) +
    geom_text(aes(label = "ab", y = 27, x = 1)) +
  geom_text(aes(label = "b", y = 91, x = 2)) +
  geom_text(aes(label = "c", y = 198, x = 3)) +
  geom_text(aes(label = "a", y = 48, x = 4)) +
  geom_text(aes(label = "b", y = 140, x = 5))

data_text <- data.frame(label = c("a", "b", "b","a", "b", 
                                  "a", "b", "c","a", "b",
                                  "ab", "ab", "b","a", "a"),
                        Periode = rep(c("Juin", "Mi-juillet", "Fin juillet"), each = 5),
                        x = c(1,2,3,4,5,
                              1,2,3,4,5,
                              1,2,3,4,5),
                        y = c(15,93,85,28,123,
                              25,80,198,10,113,
                              98,43,125,19,50))
data_text$Periode <- fct_relevel(data_text$Periode, c("Juin", "Mi-juillet", "Fin juillet"))
Interactions_Gestion %>% 
  group_by(Site_gestion_date, Periode, Gestion_moment_5) %>% 
  summarize(n= sum(N_Interactions)) %>% 
  ggplot(aes (x = Gestion_moment_5, y = n)) + 
  facet_wrap(~Periode)+
  geom_boxplot(aes (color = Gestion_moment_5), alpha = 0.70) + 
  scale_color_manual(values = c("Graminées" = "#fbcb09",
                                "Fleuri" = "#ff7207",
                                "Semé" = "#de1e21",
                                "Tonte récente" = "#6abe1d",
                                "Tonte tardive" = "#2b790c")) + 
  labs(x = "Type de gestion", y = "Somme des interactions", color = "Type de gestion") +
  theme(legend.position = "none",
        legend.title = element_text(size=11), 
        legend.text = element_text(size=10),
        axis.text.y = element_text(size=10),
        axis.text.x = element_text(size=8),
        axis.title = element_text(size=14),
        strip.text = element_text(size=10)) +
   geom_text(data = data_text %>% filter(Periode == Periode), 
             mapping = aes(x = x, y = y, label = label),
             size = 4, fontface = "bold")

5.6.3 LM5_nvis : nvis_fl_h

#voir mod précédent effet t°, Periode

Interactions_nvis_fl_h %>% 
  ggplot(aes (x = Periode, y = nvis_fl_h)) + 
  facet_wrap(~Sp_Pollinisateurs) +
  geom_boxplot(aes (color = Gestion_moment_5), alpha = 0.70) +
    scale_y_continuous(trans='log10',
                     breaks=c(0.010, 0.100,1.000, 10),
                     labels=c("0.01","0.1","1", "10")) +
    scale_color_manual(values = c("Graminées" = "#fbcb09",
                                  "Fleuri" = "#ff7207",
                                  "Semé" = "#de1e21",
                                  "Tonte récente" = "#6abe1d",
                                  "Tonte tardive" = "#2b790c")) +
  labs(x = "Période", y = "Nombre de visites par unité florale par heure (nvis/uf.h)", color= "Type de gestion") +
     theme(legend.position = "bottom",
        legend.title = element_text(size=11), 
        legend.text = element_text(size=10),
        axis.text = element_text(size=11),
        axis.title = element_text(size=14),
        strip.text = element_text(size=10, face = "italic"))

5.7 Interactions ou non

Interactions_Gestion %>% 
  group_by(Gestion_moment_5) %>% 
  summarize(tot = n())
## # A tibble: 5 × 2
##   Gestion_moment_5   tot
##   <fct>            <int>
## 1 Graminées          108
## 2 Fleuri             652
## 3 Semé               765
## 4 Tonte récente       78
## 5 Tonte tardive      465
E_O <- data.frame(Gestion_moment_5 = c(rep(c("Graminées","Graminées","Fleuri", "Fleuri","Semé","Semé","Tonte récente","Tonte récente","Tonte tardive","Tonte tardive"),2)),
                  EO = c(rep("O",10), rep("E",10)),
                  Inter_YN= c(rep(c("Pas d'interactions","Interactions"),10)),
                  EO_YN = c(rep(c("Pas d'interactions, observé","Interactions, observé"),5), rep(c("Pas d'interactions, attendu","Interactions, attendu"),5)),
                  totEO = c(16,92,89,563,99,666,27,51,87,378,16.61,91.39,100.26,551.74,117.64,647.36,11.99,66.01,71.50,393.50))
# n <- Interactions_Gestion %>%
#   group_by(Gestion_moment_5, Inter_YN) %>%
#   mutate(Inter_YN = as.factor(Inter_YN)) %>%
#   summarize(n = n())
# YN <- full_join(tot,n)
# YN %>% 
#   ggplot(aes(x = Gestion_moment_5, y= n, color = Gestion_moment_5, shape = Inter_YN)) +
#   geom_point(size = 4) +
#     scale_color_manual(guide = F, values = c("Graminées" = "#fbcb09",
#                                   "Fleuri" = "#ff7207",
#                                   "Semé" = "#de1e21",
#                                   "Tonte récente" = "#6abe1d",
#                                   "Tonte tardive" = "#2b790c")) +
#   scale_shape_manual(values = c("Pas d'interactions" = 15,
#                                   "Interactions" = 17)) +
#   guides(shape = guide_legend(title = "")) +
#   labs(x = "Type de gestion", y = "Compte") +
#   theme(legend.position = "bottom",
#         axis.text=element_text(size=10),
#         axis.title=element_text(size=14),
#         strip.text = element_text(size = 12))
E_O$Gestion_moment_5 <- fct_relevel(E_O$Gestion_moment_5,c("Graminées", "Fleuri", "Semé", "Tonte récente", "Tonte tardive"))
E_O %>% 
  ggplot(aes(x = Gestion_moment_5, y = totEO, color = Gestion_moment_5, shape = EO_YN)) +
  geom_point(size = 4) +
    scale_color_manual(guide = F, values = c("Graminées" = "#fbcb09",
                                  "Fleuri" = "#ff7207",
                                  "Semé" = "#de1e21",
                                  "Tonte récente" = "#6abe1d",
                                  "Tonte tardive" = "#2b790c")) +
  scale_shape_manual(values = c("Pas d'interactions, observé" = 16,
                                  "Interactions, observé" = 17,
                                "Pas d'interactions, attendu" = 1,
                                  "Interactions, attendu" = 2)) +
  guides(shape = guide_legend(title = "")) +
  labs(x = "Type de gestion", y = "Compte") +
  theme(legend.position = "bottom",
        axis.text=element_text(size=14),
        axis.title=element_text(size=16),
        legend.text = element_text(size = 13))

E_O %>% 
  filter(EO == "O") %>% 
ggplot()+ aes(x = Gestion_moment_5, y = totEO, fill = Inter_YN) +
  geom_col(alpha = 0.5) +
  scale_fill_manual(values = c("Interactions" = "#3da834",
                               "Pas d'interactions" = "#c54126")) +
   # scale_color_manual(guide = F, values = c("Graminées" = "#fbcb09",
   #                                "Fleuri" = "#ff7207",
   #                                "Semé" = "#de1e21",
   #                                "Tonte récente" = "#6abe1d",
   #                                "Tonte tardive" = "#2b790c")) +
  geom_segment(x = 0.5, xend = 1.5, y= 16.61, yend = 16.61, color="#fbcb09",linewidth=1)+
  geom_segment(x = 1.5, xend = 2.5,y= 100.26,yend= 100.26, color = "#ff7207",linewidth=1)+
  geom_segment(x = 2.5, xend = 3.5,y= 117.64,yend= 117.64, color = "#de1e21",linewidth=1)+
  geom_segment(x = 3.5, xend = 4.5,y= 11.99,yend= 11.99, color = "#6abe1d",linewidth=1)+
  geom_segment(x = 4.5, xend = 5.5,y= 71.50,yend= 71.50, color = "#2b790c",linewidth=1) +
    theme(legend.position = c(0.9,0.97),
        legend.text = element_text(size=10),
        axis.text=element_text(size=12),
        axis.title=element_text(size=14)) + 
  labs(x= "Type de gestion", y = "Compte", fill = "")

5.8 Nombre de changements de fleurs/sp

join_sum_n <- join_sum_n %>% 
  mutate(n = as.factor(n))
levels(join_sum_n$n) <- c("1 espèce visitée", "2 espèces visitées", "3 espèces visitées")
join_sum_n %>% 
  ggplot(aes(x = Classe_Poll, y = sum))+
  facet_wrap(~n) +
  geom_boxplot(aes (color = Gestion_moment_5), alpha = 0.70) + 
    scale_color_manual(values = c("Graminées" = "#fbcb09",
                                  "Fleuri" = "#ff7207",
                                  "Semé" = "#de1e21",
                                  "Tonte récente" = "#6abe1d",
                                  "Tonte tardive" = "#2b790c")) +
  labs(x = "Catégories de pollinisateurs", y = "Nombre d'unités florales visitées en séquence", color = "Type de gestion", title = "Nombre d'espèces de plantes en fleur différentes visitées") + 
  theme(legend.position = "bottom", 
        axis.text.x = element_text(size = 6),
        axis.text.y=element_text(size=10),
        axis.title=element_text(size=14),
         strip.text = element_text(size = 12),
        axis.title.y=element_text(angle=-90, vjust=0.5))

5.9 Réseaux Plantes_pollinisateurs

plotweb(network_fauche, high.lablength= 35, low.lablength=27, col.high=c("#aa1e0f"),col.low=c("#aa1e0f"), text.rot=90, y.width.high=0.07, y.width.low=0.07, y.lim=c(-1,3.5))

plotweb(network_tonte, high.lablength= 35, low.lablength=27, col.high=c("#12661f"),col.low=c("#12661f"),text.rot=90,y.width.high=0.07, y.width.low=0.07,y.lim=c(-1,3.5))

plotweb(network_gram, high.lablength= 35, low.lablength=27,  col.high=c("#fbcb09"),col.low=c("#fbcb09"), text.rot=90, y.width.high=0.07, y.width.low=0.07, y.lim=c(-1,3.5))

plotweb(network_fleuri, high.lablength= 35, low.lablength=27,  col.high=c("#ff7207"),col.low=c("#ff7207"), text.rot=90, y.width.high=0.07, y.width.low=0.07, y.lim=c(-1,3.5))

plotweb(network_seme, high.lablength= 35, low.lablength=27,  col.high=c("#de1e21"),col.low=c("#de1e21"), text.rot=90, y.width.high=0.07, y.width.low=0.07, y.lim=c(-1,3.5))

plotweb(network_TonRec, high.lablength= 35, low.lablength=27,  col.high=c("#6abe1d"), col.low=c("#6abe1d"), text.rot=90, y.width.high=0.07, y.width.low=0.07, y.lim=c(-1,3.5))

plotweb(network_TonTard, high.lablength= 35, low.lablength=27,  col.high=c("#2b790c"), col.low=c("#2b790c"), text.rot=90, y.width.high=0.07, y.width.low=0.07, y.lim=c(-1,3.5))

plotweb(network_Juin, high.lablength= 35, low.lablength=27,  col.high=c("#74a9cf"), col.low=c("#74a9cf"), text.rot=90, y.width.high=0.07, y.width.low=0.07, y.lim=c(-1,3.5))

plotweb(network_miJuil, high.lablength= 35, low.lablength=27,  col.high=c("#2b8cbe"), col.low=c("#2b8cbe"), text.rot=90, y.width.high=0.07, y.width.low=0.07, y.lim=c(-1,3.5))

plotweb(network_finJuil, high.lablength= 35, low.lablength=27,  col.high=c("#045a8d"), col.low=c("#045a8d"), text.rot=90, y.width.high=0.07, y.width.low=0.07, y.lim=c(-1,3.5))

Table_NW_P 
##                            Juin Mi-juillet Fin juillet
## connectance           0.1352785  0.1303030   0.1064815
## web asymmetry         0.3809524  0.3924051   0.3846154
## weighted nestedness   0.5246653  0.5805779   0.5296713
## linkage density       4.7004410  4.2604178   3.6859752
## Fisher alpha         61.9488092 44.7255342  40.7488484
## Shannon diversity     3.7803507  3.5367435   3.1842605
## interaction evenness  0.5165444  0.4922134   0.4442924
## H2                    0.5157954  0.4665388   0.5867317
## robustness.HL         0.7788051  0.7668089   0.7323744
## robustness.LL         0.6363928  0.6371332   0.5838619
## generality.HL         3.9909709  3.5874657   3.0955332
## vulnerability.LL      5.4099111  4.9333699   4.2764171
# %>%
  # kbl(caption = "Période") %>%
  # kable_classic(full_width = F, html_font = "Cambria") #%>% kable_styling() %>%
#save_kable(file = "Output/Tableau/NW_P.pdf")
Table_NW_G2 
##                           Fauche      Tonte
## connectance            0.1181478  0.2943723
## web asymmetry          0.4590164  0.6500000
## weighted nestedness    0.6686565  0.4727312
## linkage density        6.9668799  2.1539505
## Fisher alpha         102.2384405 13.8299152
## Shannon diversity      4.5609652  1.6289212
## interaction evenness   0.5711813  0.2993010
## H2                     0.4291655  0.6866345
## robustness.HL          0.7905750  0.8376929
## robustness.LL          0.6427648  0.5099233
## generality.HL          5.2007056  1.3405415
## vulnerability.LL       8.7330541  2.9673596
# %>% 
#   kbl(caption = "Gestion - biclassification") %>%
#   kable_classic(full_width = F, html_font = "Cambria") # %>% kable_styling() %>%
 # save_kable(file = "Output/Tableau/NW_G2.pdf")
Table_NW_G5 
##                       Graminées     Fleuri       Semé Tonte récente
## connectance           0.2407407  0.1142534  0.1418764     0.4722222
## web asymmetry         0.6363636  0.4468085  0.4250000     0.6000000
## weighted nestedness   0.3958483  0.5646260  0.6423572     0.3757457
## linkage density       4.5620168  5.5351438  4.9818744     1.9228986
## Fisher alpha         15.7290348 71.1656509 54.1504976     4.6059563
## Shannon diversity     3.2435071  4.2667950  3.8437780     1.2878123
## interaction evenness  0.6375323  0.5706099  0.5354536     0.3593709
## H2                    0.7336450  0.5114385  0.4496612     0.8104420
## robustness.HL         0.8052689  0.7730934  0.7710849     0.7025725
## robustness.LL         0.4016080  0.6190162  0.6374439     0.3201852
## generality.HL         1.4745200  3.8796971  3.3251203     1.1012144
## vulnerability.LL      7.6495137  7.1905906  6.6386285     2.7445828
##                      Tonte tardive
## connectance              0.2857143
## web asymmetry            0.6500000
## weighted nestedness      0.4584951
## linkage density          2.1270847
## Fisher alpha            13.6693767
## Shannon diversity        1.6404026
## interaction evenness     0.3014106
## H2                       0.6990216
## robustness.HL            0.8498949
## robustness.LL            0.5047716
## generality.HL            1.3308515
## vulnerability.LL         2.9233178
# %>%
#   kbl(caption = "Gestion - pentaclassification") %>%
#   kable_classic(full_width = F, html_font = "Cambria") #%>% kable_styling() %>%
# save_kable(file = "Output/Tableau/NW_G5.pdf")

# write.csv2(Table_NW_G5, file = "Output/Tableau/NW_G5.csv")
# write.csv2(Table_NW_G2, file = "Output/Tableau/NW_G2.csv")
# write.csv2(Table_NW_P, file = "Output/Tableau/NW_P.csv")

5.10 Tonte

5.10.1 LM6_Tonte_S

Tonte_pl %>% ggplot(aes (x = Jour_af_tonte, y = S, color = Site)) + 
  geom_point() +
  geom_smooth(se = F)+
  scale_x_continuous(n.breaks=17)+
  labs(x = "Jour après la tonte", y = "Richesse spécifique en plantes") +
        theme(legend.position = "bottom",
        axis.text=element_text(size=10),
        axis.title=element_text(size=14))

5.10.2 LM6_Tonte_Ab

Tonte_pl %>% ggplot(aes (x = Jour_af_tonte, y = Qtté, color=Espèces)) + 
  facet_wrap(~Site) +
  geom_smooth(se = F)+
  scale_color_viridis_d(option = "viridis", direction = -1) +
  geom_point(shape = "circle", size = 1.5) +
  scale_x_continuous(n.breaks=17) +
  labs(x = "Jour après la tonte", y = "Abondance en plantes") +
           theme(legend.position = "right", 
        axis.text=element_text(size=10),
        axis.title=element_text(size=14),
         strip.text = element_text(size = 12)) +
  theme_classic()

5.11 Estimation % diversité totale

Estim <- Inventaire %>% 
  rownames_to_column(var = "temp")
Estim <- Estim[,c(12, 20:167)]

Estim <- aggregate(.~ Gestion_moment_5, data=Estim, FUN= "sum")

Estim$S_Pl <- specnumber(Estim[2:50])
Estim$Ab_Plant <- rowSums(Estim[2:50])
Estim$S_Poll <- specnumber(Estim[51:149])
Estim$Ab_Poll <- rowSums(Estim[51:149])

Estim <- Estim[, c(1,150:153)]
Estim$Pl_tot <- Estim$S_Pl/49
Estim$Poll_tot <- Estim$S_Poll/99
# Plantes : 49 sp au total dans les quadrats
# Pollinisateurs: 99 sp au total dans les quadrats
shape <- c("Plantes" = 8, "Pollinisateurs" = 19)
Estim %>% 
  ggplot(aes(x = Gestion_moment_5)) + 
  geom_point(aes(y = Pl_tot, color = Gestion_moment_5, shape = "Plantes"), 
             size = 3) + 
  geom_point(aes(y = Poll_tot, color = Gestion_moment_5, shape = "Pollinisateurs"), size = 3) +
      scale_shape_manual(values = shape) +
      scale_color_manual(guide = 'none',values = c("Graminées" = "#fbcb09",
                                  "Fleuri" = "#ff7207",
                                  "Semé" = "#de1e21",
                                  "Tonte récente" = "#6abe1d",
                                  "Tonte tardive" = "#2b790c")) +
  labs(x = "Type de gestion", y = "Proportion d'espèces relative à la diversité totale", shape = "") +
  # pour chaque type de gestion sur le nombre total\n d'espèces rencontrées sur l'ensemble des quadrats
  theme(legend.position = c(0.9,0.95),
        legend.text = element_text(size=10),
        axis.text=element_text(size=10),
        axis.title=element_text(size=14))